The reason why we get failures is because attempting to create a file or directory on an exFAT file system with a Latin-1 encoded name without translation to Unicode is illegal.
Example:
Code: Select all
mkdir("f\xf6\xf6", S_IRWXU | S_IRWXG | S_IRWXO)
...(directory name "föö" encoded as Latin-1) will return EINVAL if the current rectory is /media/fat, but succeed if in, e.g. /root.
Sorgelig wrote: ↑Tue Dec 15, 2020 2:24 pm
It would be good to keep linux filenames in Latin code page.
Even if the Linux filesystem supported Latin-1, the user is then faced with annoying filenames, or even "mojibake", because the system is almost certainly expecting Unicode, and their terminal doesn't know how to correctly represent the characters:
- Clipboard Image.jpg (20.51 KiB) Viewed 8280 times
This could get even worse if you are trying to manage these files over a Samba share or other remote access method that may need yet another conversion to work correctly. It's jut not practical.
I maintain that translating to UTF-8 and back again is the best experience for the user, and not much of a problem for us because converting between Latin-1 and UTF-8 is trivial.
If we don't want to add a Latin-1 locale to the Linux system and enable the use of iconv to perform the conversion via glibc, a couple of hand-written conversion functions takes care of this easily.
I've implemented some simple conversion functions and it seems to work very nicely. You can extract, e.g. BoulderDäsh on the Amiga side, and you can even see the correct names if accessing the Amiga shared directory through Samba:
- Clipboard Image 2.jpg (17.13 KiB) Viewed 8280 times
If the Linux side contains file/directory name that
cannot be converted to Latin-1 perfectly, it is simply ignored and won't appear on the Amiga side.
I've attached a new MiSTer executable (again, place on root of SD card) - you shouldn't need to update the Amiga driver.
Please test, and if we're happy, I'll send a pull request.