Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- From: Robert Harris <robert.f.harris@xxxxxxxxxxxxxxxx>
- Date: Mon, 08 Oct 2007 13:05:13 GMT
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 !
I use to connect through VPN, at work, to my client's LAN. They use Latin-1, I use Latin-2.
How can I tell that programmatically and portably ? My app has to work with files from both machines.
I would like a standard way to get that encoding, and the file system should be the first to know about it.
I guess I will just have to rely on the user passing the encoding for files whose names I process on the command line, or else assume the LC_* default.
This is not allways possible, for example when simply browsing the FS (like the GUI shell does), you can not ask the user for the encoding of files before browsing ...
I would like POSIX to fix this problem.
P.S. Fortunately me and my client have only used 7-bit ASCII characters in file names until now.
Thank you,
Timothy Madden,
Romania
The only portable solution is to use UNICODE everywhere!
Robert
.
- Follow-Ups:
- 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 ?
- 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
- Any portable way get a filename in UTF-8 or to get the FS encoding ?
- Prev by Date: Re: Need suggestion on UDP Concurrent server
- Next by Date: Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- 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
|