Php utf8_decode()不适用于&;恩达什;Z
我正在用图像创建一个图像,该图像应具有以下文本: A–Z 但不知何故,长破折号不能正确显示,而不是显示字符串的破折号 如何使该生产线工作:Php utf8_decode()不适用于&;恩达什;Z,php,utf-8,imagemagick,Php,Utf 8,Imagemagick,我正在用图像创建一个图像,该图像应具有以下文本: A–Z 但不知何故,长破折号不能正确显示,而不是显示字符串的破折号 如何使该生产线工作: utf8_decode('A–Z'); 所以它显示 A-Z长划 当前它只返回参数中的字符串: 编辑 完整功能: protected function createImg($font = 'Helvetica-LT-55-Roman') { $borderPadding = '50x0'; $calcWidth =
utf8_decode('A–Z');
所以它显示
A-Z长划
当前它只返回参数中的字符串:
编辑
完整功能:
protected function createImg($font = 'Helvetica-LT-55-Roman')
{
$borderPadding = '50x0';
$calcWidth = 720;
$calcSize = $calcWidth . 'x520';
$textEdu = utf8_decode('Lorem Ipsum A–Z Lorem Ipsum');
$command = env('IMCONVERT', '') . ' -size ' . $calcSize . ' -background transparent -fill white -font ' . $font . ' -pointsize 22 -gravity west -interline-spacing 5 label:"' . $textEdu . '" -matte -bordercolor none -border ' . $borderPadding . ' -strokewidth 1 -stroke white -fill none -draw "line 203,100" ' . $this->path . 'menu\\ímg.png';
return $command;
// In my constructor() I just Shell_exec() the function and the Image gets created
}
这里使用HTML实体。所以utf8解码什么都不做。 要解码可以使用的html实体:
html_entity_decode('A–Z');
链接:
在我看来,它好像在工作。它做错了什么?@FKEinternet我对我的问题进行了更详细的编辑,是否可以使用html_entity_decode('A–Z');内部utf8_解码()?可能不是,或者?如果您还想进行utf8\u解码,您可以将其放在html\u entity\u decode()中,您可以提供使用此字符串的位置的更多脚本吗?好的,我添加了创建图像的函数,如果您将utf8\u decode()更改为html\u entity\u decode(),则无法工作?