Dirk Meyer wrote: > Hi > > Duncan Webb wrote: >> I've a question about Python's Unicode handling and hope that someone >> can help. > > Unicode in Python sucks!
Completely agree >> First, when a string is a Unicode string does this mean that every >> character is 2 or 4 bytes wide? > > No idea. Didn't ask this correctly, what I meant is do the characters get stored as 1 byte or many, I think from the example that the Unicode string is multibyte. "Glück *" which translates to: u'Gl\xfcck \u2605' # as a Unicode string 'Gl\xc3\xbcck \xe2\x98\x85' # as a utf8 string >> Second, file names from a fat system seem to be in latin1 but on the >> ext2/3 are in utf8. How can they be processed in a safe way without >> causing UnicodeErrors? > > They are? That should not be the case. There is a system variable what > your defualt encoding is and what the filesytem encoding is. To avoid > errors in any kind, kaa.beacon uses strings for filenames all the > time, everything else is unicode. I suggest you do the same. Okay, will do >> This is related to the new library module in freevo-1, Wout and I are >> having trouble fixing it to work in all cases. > > One solution would be to use str_to_unicode and unicode_to_str from > kaa.strutils (part of kaa.base). The code is similar to the Unicode > and String functions in freevo 1.x. But I'm not sure it will be > correct in any case for filenames, so you should keep them as they > are. Much clearer names that decode and encode. Thanks Duncan ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Freevo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-devel
