Recent Changes - Search:


UnicodeNotes

Unicode decode exceptions has been a problem for a long time with GNU Solfege. We need to decode all strings to unicode as soon as possible. We should use only unicode strings internally.

A list of sources of byte strings to watch out for:

  • os.getcwd(), so we should only use os.getcwdu()
  • __file__ : use __file__.decode(sys.getfilesystemencoding(), 'replace')
  • All tracebacks has to be decoded before we display them in gtk.
  • lesson files
  • data files defining training sets. Those are parsed with dataparser.

Dataparser

Status per 2.9.2, almost ready with 3.9.3 The Dataparser class' method parse_string take a str type string and will decode it to unicode itself. It will assume it is UTF-8 unless there is a string defining the encoding. Example:

 # -*- coding: iso-8859-1 -*-

This breaks with what we say above, that we should convert all strins to unicode as soon as they enter the program.

Edit - History - Print - Recent Changes - Search
Page last modified on October 22, 2007, at 10:15 PM