diff --git a/po/update_po.py b/po/update_po.py index fc483569d..6c710af21 100644 --- a/po/update_po.py +++ b/po/update_po.py @@ -169,12 +169,13 @@ def TipsParse(filename, mark): tips = open('../data/tips.xml.in.h', 'w') marklist = root.iter(mark) for key in marklist: + tip = ElementTree.tostring(key, encoding="UTF-8", method="xml") if sys.version_info[0] < 3: - tip = ElementTree.tostring(key, encoding="UTF-8") - else: # no python3 support yet - return - tip = tip.replace("", "") - tip = tip.replace('\n<_tip number="%(number)s">' % key.attrib, "") + tip = tip.replace("", "") + tip = tip.replace('\n<_tip number="%(number)s">' % key.attrib, "") + else: # python3 support + tip = tip.decode(encoding="UTF-8") + tip = tip.replace('<_tip number="%(number)s">' % key.attrib, "") tip = tip.replace("
", "
") #tip = tip.replace("\n\n", "\n") # special case tip 7 #tip = tip.replace("\n", "") # special case tip 18