Store CFF names in UTF-8
We switched XML encoding from Latin-1 to UTF-8. Adjust CFF
code.
diff --git a/Lib/fontTools/cffLib.py b/Lib/fontTools/cffLib.py
index dd0112c..54c9cf2 100644
--- a/Lib/fontTools/cffLib.py
+++ b/Lib/fontTools/cffLib.py
@@ -672,6 +672,11 @@
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")