[ttx] Control chars in xml #71

Open
behdad opened this Issue Dec 10, 2013 · 2 comments

Projects

None yet

2 participants

@behdad
Member
behdad commented Dec 10, 2013

Currently, we write out control chars to XML. That's invalid XML. Need to escape those. Can be in a feature tag, or name table, or CFF, etc. Test for example with Salsa-Regular.otf from googlefontdirectory.

@behdad
Member
behdad commented Jan 16, 2014

Also:
https://sourceforge.net/p/fonttools/bugs/41/

"""
See https://bugs.launchpad.net/ubuntu/+source/ttf-century-catalogue/+bug/783347

It is possible for that font to have ttx create a line like:

which cannot be processed by other tools working on the XML data structure.

Please improve ttx so this will cannot happen. Either exit(1) or try to repair the data.
"""

I'm not sure what we get with current code, specially it may be different between Python2 and Python3.

@anthrotype
Member

Reminder to self: see if we can define extra markup to escape invalid control chars in XML.

some relevant links:
https://www.w3.org/International/questions/qa-controls
http://stackoverflow.com/questions/4513672/python-escaping-non-ascii-characters-in-xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment