I would like to know the character encoding of the file names in a filesystem in order to display correctly them in a GUI.
How should I do this ?
I suppose I get different character encoding depending on the file system (FAT, NTFS, ext3, etc.)
Thank you
(I work in C++ but this topic is not language related)
NTFS is Unicode (UTF-16). exFAT is Unicode as well.
Original FAT and fAT32 use OEM character set (read more on MSDN).
On Linux and Unix filename may contain any bytes except NUL and the charater set is not defined. Consequently each application decides itself which one to use. Many applications use UTF8. See more in this question.
The above unix approach is used on most filesystems (mainly because the "charset" concept has more meaning on the OS level than on the storage level). You can check FS capabilities and requirements regarding filename characters here (table 2 column 3).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With