* Kristine Daniels <[EMAIL PROTECTED]> [2005-11-12 21:09]:
> There are two similar bugs.  I'll report both here, but will gladly split
> them out if requested.

Sorry for the late response.  For some reason, I never received this
report or your follow-up.

> The first is when doing cleanup after 'jack -Q -R' by editing
> jack.freedb to replace high ascii characters such as รถ (little o with umlaut)
> with English transliterations and doing a 'jack -R'

Please try this patch:

diff -urN jack-3.1.1~/jack_freedb.py jack-3.1.1/jack_freedb.py
--- jack-3.1.1~/jack_freedb.py  2005-12-01 01:03:55.000000000 +0000
+++ jack-3.1.1/jack_freedb.py   2005-12-01 01:06:20.000000000 +0000
@@ -84,7 +84,7 @@
             if jack_utils.check_path(dirs_created, old_dirs) and not 
jack_utils.check_path(dirs_created, new_dirs):
                 jack_utils.rename_path(dirs_created, new_dirs)
                 print "Info: cwd now", os.getcwd()
-                jack_functions.progress("all", 'ren', dir_created + "-->" + 
unicode(new_dir, cf['_charset']))
+                jack_functions.progress("all", 'ren', unicode(dir_created + 
"-->" + new_dir), cf['_charset'], "replace")
 
     if not err:
         names_available = 1


> The second is when the umlaut is some multi-byte representation.
> (Unicode?).  'jack -R' complains of a problem accessing the CD-ROM.
> Here's what I see when I turn on debug.
...
> Access of CD device /dev/cdrom resulted in error: Input/output error

Your follow-up is correct jack.progess is always in UTF-8, but the
filename of your sound files uses the encoding of your locale.  When
jack checks whether all files are there, it thinks some are missing
(because the comparison of UTF-8 and locale filename doesn't match)
and tries to rip/encode them again: therefore the CD-ROM error.

Here's a patch that should work.  I need to test this some more
tomorrow because I'm really tired now and need to sleep but I think
this'll work.

The whole UTF-8 support should be re-worked at some point...


diff -urN jack-3.1.1~/jack_prepare.py jack-3.1.1/jack_prepare.py
--- jack-3.1.1~/jack_prepare.py 2005-12-01 01:03:55.000000000 +0000
+++ jack-3.1.1/jack_prepare.py  2005-12-01 01:48:56.000000000 +0000
@@ -403,7 +403,7 @@
                 if status[i]['names'][-1] == names[0]:
                     status[i]['names'].append(names[1])
             if type(i) == types.IntType:
-                tracknum[i][NAME] = status[i]['names'][-1]
+                tracknum[i][NAME] = unicode(status[i]['names'][-1], "utf-8", 
"replace").encode(cf['_charset'], "replace")
         del status[i]['ren']
 
     # status info for the whole CD is treated separately


Can you confirm that this works and do some random tests?
-- 
Martin Michlmayr
http://www.cyrius.com/

Reply via email to