mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2025-01-25 03:32:02 +02:00
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>
This commit is contained in:
parent
34a14990b0
commit
c1859cfb47
@ -322,7 +322,7 @@ def fetch_glyphnames():
|
||||
""" Read the glyphname database and put it into a dictionary """
|
||||
try:
|
||||
glyphnamefile = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), 'glyphnames.json'))
|
||||
with open(glyphnamefile, 'r') as f:
|
||||
with open(glyphnamefile, 'rb') as f:
|
||||
namelist = json.load(f)
|
||||
return { int(v['code'], 16): k for k, v in namelist.items() if 'code' in v }
|
||||
except Exception as error:
|
||||
|
Loading…
x
Reference in New Issue
Block a user