relan / exfat

Free exFAT file system implementation
GNU General Public License v2.0
789 stars 179 forks source link

Support for other character sets than UTF #107

Open feanor80 opened 5 years ago

feanor80 commented 5 years ago

I noticed that the exfat implementation does not work in environments with different character encodings than UTF-8, e.g. ISO-8859-1. It ignores mount option iocharset in comparison to its counterpart implementation for vfat file systems, if I understand correctly.

How to reproduce: Open a terminal, set character encoding to ISO-8859-1 and type the following:

$ export LC_ALL=en_US.ISO8859-1
$ mount -o iocharset=iso8859-1 <device> <path>
$ cd <path>
$ touch Ä
touch: cannot touch 'Ä': Invalid or incomplete multibyte or wide character

While I understand that UTF-8 should be the standard today, it would probably be nice to have full support for legacy systems.

relan commented 5 years ago

You are right, fuse-exfat never supported anything but UTF-8 (iocharset option is ignored).

It would indeed be nice if someone implemented support for other encodings. :)

hselasky commented 1 year ago

Hi there,

There is something called "Latin-1 Supplement":

https://www.wikidata.org/wiki/Q574509

If you convert those characters to proper UTF-8 codes first, then they will in turn be converted to proper UTF-16 codes, which I think is what Ex-fat is using. Maybe this is also a shell issue / c-locale enviroment issue.

Beware that some common OS'es, like recent MacOS (Monterey at least) may stop showing all such files and directories, depending on the character code. They will go totally invisible, but still exist in the file system, but to no avail.

--HPS