PHP function imagettftext() and unicode

前端 未结 5 1109
说谎
说谎 2020-11-30 07:09

I\'m using the PHP function imagettftext() to convert text into a GIF image. The text I am converting has Unicode characters including Japanese. Everything works fine on my

5条回答
  •  日久生厌
    2020-11-30 07:37

    My prime suspect is the font you are using for rendering.

    According to http://fr3.php.net/imagettftext, different versions of the GD library used by php can show different behaviour.

    • GD Version on your local machine: 2.0 or higher
    • GD Version on your webhost server: bundled (2.0.34 compatible)

    Edit: Another idea: can you verify that $text = '日本語'; is really saved like this on your production server? Maybe there is an encoding problem with your script.

    Next edit: BKB already proposed that. So in case this is the cause: he was first with the answer ;-)

提交回复
热议问题