Any portable way get a filename in UTF-8 or to get the FS encoding ?
- From: Timothy Madden <terminatorul@xxxxxxxxx>
- Date: Sun, 07 Oct 2007 22:22:12 +0300
Hello,
I am trying to devise a simple tool in which I read many directory and file names (to compare two directories).
I never wrote code that I would port to different systems, but I would not mind doing it now.
So I download and read sus v2 and sus v3 to see the openddir/readdir/closedir functions, but they only return char[] strings for file names and they say nothing about the encoding of the file names.
A computer system may mount and/or access many kinds of file systems. NTFS as I know is an UNICODE file system (Sorry I do not know how ufs or extfs are). When mounting FAT systems one can explicitly specify a charset for all the file names.
I have seen _wreaddir function in some implementations, but is there a portable way to get a file's name in UTF-8 or to get a file name in the underlaying encoding of its file system and to get the encoding ?
Are POSIX implementations required to convert the file name return by readdir to the application's execution character set ?
Thank you,
Timothy Madden,
Romania
.
- Follow-Ups:
- Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- From: Gianni Mariani
- 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: Robert Harris
- Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- Prev by Date: Re: a tool for debugging memory leaks? for ARM and OS-Linux
- Next by Date: Re: Define feature flags for use in Makefiles and C code?
- Previous by thread: Output of ldd
- Next by thread: Re: Any portable way get a filename in UTF-8 or to get the FS encoding ?
- Index(es):
Relevant Pages
|