* HACKING:

More unicode notes.
	* morituri/common/program.py:
	* morituri/image/table.py:
	* morituri/image/toc.py:
	* morituri/result/result.py:
	* morituri/rip/cd.py:
	* morituri/test/test_image_toc.py:
	  Further unicode fixes, for options, CD-Text, paths, ...
This commit is contained in:
Thomas Vander Stichele
2009-09-11 22:16:46 +00:00
parent f3bf6220fb
commit dfa3efe662
8 changed files with 72 additions and 14 deletions

View File

@@ -128,16 +128,21 @@ class TocFile(object, log.Loggable):
if m:
key = m.group('key')
value = m.group('value')
# usually, value is encoded with octal escapes and in latin-1
# FIXME: other encodings are possible, does cdrdao handle
# them ?
value = value.decode('string-escape').decode('latin-1')
if key in table.CDTEXT_FIELDS:
# FIXME: consider ISRC separate for now, but this
# is a limitation of our parser approach
if state == 'HEADER':
self.table.cdtext[key] = value
self.debug('Found disc CD-Text %s: %s', key, value)
self.debug('Found disc CD-Text %s: %r', key, value)
elif state == 'TRACK':
if key != 'ISRC' or not currentTrack \
or currentTrack.isrc is not None:
self.debug('Found track CD-Text %s: %s', key, value)
self.debug('Found track CD-Text %s: %r',
key, value)
currentTrack.cdtext[key] = value
# look for header elements