Skip to content

Commit 512afb1

Browse files
committed
fix StopIteration when charset of font is UTF-8 (vs utf8)
1 parent 6064190 commit 512afb1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pycdxml/cdxml_converter/chemdraw_types.py

+2
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ def from_element(fonttable: ET.Element) -> 'CDXFontTable':
357357
for font in fonttable.iter(tag="font"):
358358
logger.debug(f"Reading font {font.attrib}.")
359359
font_id = int(font.attrib["id"])
360+
if font.attrib["charset"] == "UTF-8":
361+
font.attrib["charset"] = "utf8"
360362
charset = next(key for key, value in Font.CHARSETS.items() if value == font.attrib["charset"])
361363
font_name = font.attrib["name"]
362364
fonts.append(Font(font_id, charset, font_name))

0 commit comments

Comments
 (0)