Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为什么我生成的图片里面的中文只有方框,是不是因为encoding的问题? #5

Open
keke18532 opened this issue May 31, 2019 · 4 comments

Comments

@keke18532
Copy link

UnicodeDecodeError: 'ascii' codec can't decode byte 0xf7 in position 2: ordinal not in range(128)

@light201212
Copy link

I got the same error

@kylechang523
Copy link

Same error, have you solve this problem?

@che525538919
Copy link

我也是同样的问题,第一次执行会在with open(fc,'r',encoding='utf8') as f: for l in f.readlines():
报错UnicodeDecodeError,后面再执行脚本就不报错了,但是图片里的中文都是乱码。有的人说加“errors="ignore"”,似乎只是无视了报错信息,对在图片上生成中文没有作用。

@che525538919
Copy link

是字体的问题,首先修改fontlist.txt,将里面的路径换成中文字体的路径,比如more_font/***.ttf ,然后运行invert_font_size.py。否则找不到字体,用英文字体打印中文,当然全是“□”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants