imgkit icon indicating copy to clipboard operation
imgkit copied to clipboard

Fail to support UTF-8 text (Chinese Characters)?

Open XieGuochao opened this issue 3 years ago • 4 comments

It seems that it cannot render Chinese characters or emoji. Please fix it or provide the instructions to recover it!

XieGuochao avatar Jun 18 '21 04:06 XieGuochao

Same issue here, do you solve it?

Butterflyer043 avatar Jan 01 '22 04:01 Butterflyer043

Did you solve this?

mynameisguy avatar Jan 20 '22 08:01 mynameisguy

Hi, man. As i did. I try to send a 'ttf' file into /usr/share/fonts, and it works.

Atrbear avatar May 15 '22 18:05 Atrbear

I solved this issue in two steps.

  1. As Atrbear mentioned, put a Chinese font into /usr/share/fonts.
  2. Use the options parameter to specify the encoding as UTF-8. Ex. imgkit.from_file(htmlfilename, 'imgkit.jpg', options={'encoding': 'UTF-8'})

lip99-TW avatar Nov 25 '23 10:11 lip99-TW