Skip to content

Commit a1ec155

Browse files
committed
ignore unknown encodings
fixing #78
1 parent ac43f93 commit a1ec155

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Lib/extractor/formats/opentype.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,11 @@ def _extractInfoName(source, info):
284284
platformID = record.platformID
285285
encodingID = record.platEncID
286286
languageID = record.langID
287-
string = record.toUnicode()
287+
try:
288+
string = record.toUnicode()
289+
except UnicodeDecodeError:
290+
# ignore font names with unknown encoding
291+
continue
288292
nameIDs[nameID, platformID, encodingID, languageID] = string
289293
records.append(
290294
(

0 commit comments

Comments
 (0)