Skip to content

Commit 273b7aa

Browse files
committed
font-patcher: State encoding of datafile
[why] Some user reported a unicode decoding issue. [how] Usually it should work but when the system has some strange setting the datafile might be interpreted as something else (not utf8). When the file is opened as binary it should be decoded as utf*. Possibly fixes: #1761 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
1 parent 26bfd97 commit 273b7aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

font-patcher

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def fetch_glyphnames():
322322
""" Read the glyphname database and put it into a dictionary """
323323
try:
324324
glyphnamefile = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), 'glyphnames.json'))
325-
with open(glyphnamefile, 'r') as f:
325+
with open(glyphnamefile, 'rb') as f:
326326
namelist = json.load(f)
327327
return { int(v['code'], 16): k for k, v in namelist.items() if 'code' in v }
328328
except Exception as error:

0 commit comments

Comments
 (0)