简体   繁体   English

如何在 PHP Invoicr 脚本中设置字符集 UTF-8

[英]How to set charset UTF-8 in PHP Invoicr script

I'm using https://github.com/farjadtahir/pdf-invoicr .我正在使用https://github.com/farjadtahir/pdf-invoicr

Problem is when I add diacritics to $invoice->setFrom() (or anywhere else) diacritics not showing up.问题是当我向$invoice->setFrom() (或其他任何地方)添加变音符号时,变音符号没有出现。

I tried $invoice->setFrom(array(iconv("UTF-8", "ISO-8859-1","ÆØÅ") from this comments but still diacritics not working.我从这个评论中尝试了$invoice->setFrom(array(iconv("UTF-8", "ISO-8859-1","ÆØÅ")但变音符号仍然不起作用。

Next I tried https://stackoverflow.com/a/21555497/2893691 again not working.接下来我再次尝试https://stackoverflow.com/a/21555497/2893691不起作用。

So, how to finally convert ľščťžýáíé to UTF-8 in invoicr?那么,如何最终将ľščťžýáíé转换为ľščťžýáíé中的 UTF-8?

EDIT - NEW INFO编辑 - 新信息

I'm used mb_detect_encoding() and return is UTF-8 already.我使用了mb_detect_encoding()并且返回已经是UTF-8 But when I try show for example string ičo123 the result is empty.但是当我尝试显示例如字符串ičo123 ,结果为空。 Not showing.不显示。

I tried add header('Content-Type: text/html; charset=utf-8');我尝试添加header('Content-Type: text/html; charset=utf-8'); and still diacritics not working.并且仍然变音符号不起作用。

EDIT 2 - NEW INFO编辑 2 - 新信息

I tried this script http://www.fpdf.org/en/script/script92.php and still not working.我尝试了这个脚本http://www.fpdf.org/en/script/script92.php但仍然无法正常工作。 Here is screenshot of downloaded example from link above:这是从上面的链接下载的示例的屏幕截图:

在此处输入图片说明

问题已解决 - 使用了EDIT 2 中的脚本并从phpinvoice.php文件中删除了所有iconv()函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM