Store CFF names in UTF-8

We switched XML encoding from Latin-1 to UTF-8.  Adjust CFF
code.
This commit is contained in:
Behdad Esfahbod 2013-10-28 13:20:00 +01:00
parent 4d99d14dec
commit 8c5c966471

View File

@ -672,6 +672,11 @@ class SimpleConverter:
return attrs["value"]
class Latin1Converter(SimpleConverter):
def xmlWrite(self, xmlWriter, name, value, progress):
# Store as UTF-8
value = unicode(value, "latin-1").encode("utf-8")
xmlWriter.simpletag(name, value=value)
xmlWriter.newline()
def xmlRead(self, (name, attrs, content), parent):
s = unicode(attrs["value"], "utf-8")
return s.encode("latin-1")