Ticket #5 (new defect)

Opened 3 years ago

Last modified 3 months ago

glifLib fails reading the xml of a .glif if a non-ascii character is present in the anchor.name.

Reported by: erik Assigned to: just
Priority: major Milestone:
Component: ufoLib Version:
Keywords: glifLib, unicode Cc:

Description

<point x="551" y="1076" type="move" name="80 > 228 for ¿ asterisk"/>

At first I thought it was the >, but that seems to work fine in other glyphs which do have < or > characters, but no ¿. The .glif XML is utf-8, the ¿ character seems ok in the file.

Attachments

80three.glif (0.9 kB) - added by erik on 12/14/08 07:16:00.
.glif file with anchor with non-ascii character.

Change History

12/14/08 07:16:00 changed by erik

  • attachment 80three.glif added.

.glif file with anchor with non-ascii character.

12/14/08 07:17:10 changed by erik

  • keywords set to glyphlib.
  • owner changed from somebody to just.

12/14/08 07:19:17 changed by erik

Here's the traceback for the attached glyph:

ExpatError?: not well-formed (invalid token): line 6, column 61
module body in test.py at line 26
function readGlyph in glifLib.py at line 170
function _getXMLTree in glifLib.py at line 276
function _glifTreeFromFile in glifLib.py at line 409
function buildTree in xmlTreeBuilder.py at line 105
function _expatParseFile in xmlTreeBuilder.py at line 49
Program exited.

12/14/08 07:32:50 changed by erik

Maybe related to line 39 in xmlTreeBuilder.py:

parser.returns_unicode = 0 # XXX, Don't remember why. It sucks, though.

12/14/08 16:45:49 changed by erik

Fab's anchor.name does not return a unicode string, and it should. Even in FontLab?. This might have some repercussions.

The reader and writer in gliflib need to be tested.

12/15/08 04:40:38 changed by erik

FL on Win uses a different encoding than FL on mac. In both apps I added a oslash character in an anchor name. Then I printed them.


Mac:
'\xbf' 191


Win:
'\xf8' 248

Should fab make assumptions about the encoding of the string, based on the platform?

11/20/11 05:37:08 changed by erik

  • keywords changed from glyphlib to glifLib, unicode.
  • component changed from component1 to ufoLib.

Is this still a problem in the ufo3k branch version of glifLib?