Fixed encoding error in subset tool in Windows

Fixed encoding error in subset tool in Windows which system default codepage isn't 65001.
For Example: 
When windows default codepage is 936, the command like 'pyftsubset myfont.ttf --text-file=mytextfile.txt' will throw an exception.
This commit is contained in:
JasonAtGithub 2016-08-29 20:43:33 +08:00 committed by GitHub
parent 14740f8ee5
commit a41c60cb88

View File

@ -2902,7 +2902,7 @@ def main(args=None):
text += g[7:]
continue
if g.startswith('--text-file='):
text += open(g[12:]).read().replace('\n', '')
text += open(g[12:], encoding='utf-8').read().replace('\n', '')
continue
if g.startswith('--unicodes='):
if g[11:] == '*':