RE: RE: UNICODE support
"Simon C" <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <001401c5d520$8aeaf190$6400a8c0@HOME> |
> 1. FileView.decodefilename does nothing.
def decodefilename(self, filename):
path,filename=os.path.split(filename)
decoded_file=str(filename).decode(media_codec)
return os.path.join(path, filename)
It prevents the decode function from operating on the path of the filename
because if the path contains Unicode characters it causes str() to throw a
unicode exception.
It also fixes a problem where the path contains characters not supported by
the phone. To see what I mean, create a directory with a single quote ' in
its name and put a wallpaper file in it, go to the wallpaper tab and use the
add button or drag and drop to add this picture in this directory. Same
thing happens with ringers.
> 2. Need to account for potential use of this codec outside of FileView
> objects.
I agree.
I wonder if we should stop using the decode function as it does not work
with Unicode strings, if you pass the filename directly to the decode
function without using str() it gives an exception.
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl