Re: Detecting filename-encoding (on WinXP)?

2006-02-10 Thread Christos Georgiou
On 2 Feb 2006 08:03:14 -0800, rumours say that Tim N. van der Leeuw [EMAIL PROTECTED] might have written: So now what I need to know is, how do I find out in what encoding a particular filename is? Is there a portable way for doing this? You said the filename comes as data, and not as contents

Re: Detecting filename-encoding (on WinXP)?

2006-02-10 Thread Tim N. van der Leeuw
Actually, the directory-name comes in as a URL and as such I had no problems yet just creating a unicode-string from it which I can pass to os.walk(), and get proper unicode-filenames back from it. Then I can encode them into utf-8 and pass them to the database-layer and it all works. cheers,

Detecting filename-encoding (on WinXP)?

2006-02-02 Thread Tim N. van der Leeuw
Hi, I have a need to store directory and filenames in a database. For the database I chose to use UTF-8 encoding; but the actual encoding used is probably immaterial: whichever coding I take, I'll run into this issue eventually. At first my code worked until I ran into a directory full of

Re: Detecting filename-encoding (on WinXP)?

2006-02-02 Thread Magnus Lycka
Tim N. van der Leeuw wrote: Hi, I have a need to store directory and filenames in a database. For the database I chose to use UTF-8 encoding; but the actual encoding used is probably immaterial: whichever coding I take, I'll run into this issue eventually. At first my code worked until I

Re: Detecting filename-encoding (on WinXP)?

2006-02-02 Thread Tim N. van der Leeuw
Hi Magnus, I get the filename from a URL, which probably is not in any kind of unicode-string but just a plain ASCII string. It should be possible to cast this to an ASCII string -- I'll try it right away to see if this works. Thanks! --Tim --