From c1859cfb47d498f1ed189ab61e55dc4d4c45aae5 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Wed, 15 Jan 2025 16:07:52 +0100 Subject: [PATCH] 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 --- font-patcher | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/font-patcher b/font-patcher index fe79331af..70834e28f 100755 --- a/font-patcher +++ b/font-patcher @@ -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: