Discussion:
[BitPim-devel] fix_bad_filename
Joe Pham
2006-07-05 02:10:19 UTC
Permalink
The solution is already in place for this, no need to reinvent the
wheel.

-Joe Pham



_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com
Simon C
2006-07-05 03:24:05 UTC
Permalink
Post by Joe Pham
The solution is already in place for this, no need to
reinvent the wheel.
Do you mean the media codec?

Simon
Joe Pham
2006-07-05 03:25:15 UTC
Permalink
Yes.

-Joe Pham
Post by Joe Pham
The solution is already in place for this, no need to
reinvent the wheel.
Do you mean the media codec?

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
_______________________________________________
BitPim-devel mailing list
BitPim-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitpim-devel



_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com
Simon C
2006-07-05 03:51:12 UTC
Permalink
Yes.
I did consider using that, but it does not handle unicode. What I checked in
is a short term fix to workaround the problem.

We need to start using the proper codec for media filenames, all the index
file packets the brew file i/o packets use ascii and this does not work with
the filenames users are downloading from the carriers.

It is simple to change the codec used for brew/index files to match that of
the phone by modifying the packet definition. There is no reason why we
should not use unicode for file names as all the O/Ss (we use) support it.
The media_codec needs to be converted to support unicode as well.

I am looking at doing this soon, let me know if you are doing anything in
this area so we don't overlap.

Simon
Joe Pham
2006-07-05 04:20:22 UTC
Permalink
Post by Simon C
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.

-Joe Pham




_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com
Simon C
2006-07-05 05:58:05 UTC
Permalink
Post by Joe Pham
Post by Simon C
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
Joe Pham
2006-07-07 04:35:40 UTC
Permalink
Post by Simon C
It escapes any character outside the ascii range, even though the
filesystem can handle them.
...
It does exactly what it's supposed to do, and no phone file name has
broken it yet. If a specific OS can handle a larger set of
characters, you're welcome to improve on it.
Post by Simon C
The name shown in the gui is the escaped filename, not the original
name
IIRC, it used to do that correctly before the GUI changes.
Post by Simon C
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,
Again, that's what the codec is supposed to do transparently for you.
Post by Simon C
The O/S filename will be the same as the original filename with the
illegal characters removed.
What if you end up with identical file names after removing illegal
characters?

-Joe Pham




_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com
Joe Pham
2006-07-09 05:59:43 UTC
Permalink
Simon, are you fixing this for the next release?

-Joe Pham




_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com
Simon C
2006-07-09 06:06:44 UTC
Permalink
Post by Joe Pham
Simon, are you fixing this for the next release?
I'm going to try, time is the only issue.

Simon
Joe Pham
2006-07-10 22:52:04 UTC
Permalink
Simon, no need to rush this for this release. I backed out your work-
around 'till next release.

-Joe Pham




_____________________________________________________________________
PrivatePhone - FREE telephone number & voicemail.
A number so private, you can make it public.
http://www.privatephone.com

Loading...