Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- From: Timothy Madden <terminatorul@xxxxxxxxx>
- Date: Mon, 08 Oct 2007 17:36:45 +0300
Robert Harris wrote:
Timothy Madden wrote:[...]Fredrik Roubert wrote:On Sun, 07 Oct 2007 22:22:12 +0300, Timothy Madden wrote:[...]A process that wants to interpret the bytes that makes up a file name
must look at its environment for hints about which encoding the user
wants those file names to be interpreted as (eg. the LC_* environment
variables). You can use the mbstowcs() library function to automatically
convert a string into a wide character string according to the encoding
specified by the current environment.
How about files from a remote file system ? Than I am out of luck !
The only portable solution is to use UNICODE everywhere!
Robert
Yes, well, my app only reads directories (to compare them), so even if I use UNICODE, I still need the encoding the others have used when they created the directories and files. I want my tool to work with all the files, everywhere. That is what portability is about. Unfortunately POSIX only gives me a binary char[] array for the file name.
Timothy Madden,
Romania.
.
- References:
- Any portable way get a filename in UTF-8 or to get the FS encoding ?
- From: Timothy Madden
- Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- From: Fredrik Roubert
- Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- From: Timothy Madden
- Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- From: Robert Harris
- Any portable way get a filename in UTF-8 or to get the FS encoding ?
- Prev by Date: Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- Next by Date: Time measurements
- Previous by thread: Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- Next by thread: Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- Index(es):
Relevant Pages
|