Re: fix_bad_filename

"Simon C" <[email protected]>
Newsgroups gmane.comp.mobile.bitpim.devel
Message-ID <003401c69ff7$fd9fe1d0$0201a8c0@HOME>
> >I did consider using that, but it does not handle unicode.
> 
> It certainly does.  As a matter of fact, it's supposed to 
> handle ANY encoding name and translate it into a valid file 
> name on a specific platform.

        if ord_c<32 or ord_c>127 or \

It escapes any character outside the ascii range, even though the filesystem
can handle them.

            if len(esc_str)==3:

It also assumes all escape sequences are %xx, any ordinal above 255 will
decode incorrectly.
The media_codec assumes that all characters are one byte.

The name shown in the gui is the escaped filename, not the original name
even though the GUI can show the name that it on the phone. The solution
should show the phone's filename in the GUI and have a reasonable filename
for the host o/s so that things like cut and paste work OK, degrading to
ascii is not required.
I think the best solution is to store the original name and the filename on
the O/S in the database. The O/S filename will be the same as the original
filename with the illegal characters removed.

Simon


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.