I had set up a Tiny Core audio player appliance using mpd and GMPC which reads music files from an external usb disk. The set up is described here:
http://personal.nbnet.nb.ca/gavaris/apa.htmlThe web site indicates an NTFS formatted usb disk, but I had subsequently changed that to a FAT32 formatted disk. Everything worked fine.
Recently, I decided to experiment connecting the usb disk to an Asus router that incorporated a samba server. I loaded the cifs-utils extension and mounted the disk as a network drive. Following instructions from the TC FAQ, I did not specify any iocharset in the mount -t cifs command (I guess it uses some default?). I got a message about mismatched character encoding (my recollection of the message is a bit fuzzy) and mpd/GMPC did not generate a working music database file. I tried again and this time, being naive about TC locale, specified iocharset=utf8 in the mount command. This time the mount completed and mpd/GMPC generated a working music database file.
After experimenting, I decided to have the disk attached directly (initial set up) rather than as a network drive. When I reconnected the disk directly, I noticed that songs with non-ASCII characters in the filename were no longer visible. I suspected that the mpd/database file generated by mpd/GMPC was at fault. I deleted the database file and allowed mpd/GMPC to generate a new one. Those songs were still not visible to mpd/GMPC, though present, meaning I could not play those songs.
It should not be possible for the audio player appliance to have been corrupted since 'no backup' is specified. Indeed, the media containing Tiny Core and the audio extensions is unmounted after loading to RAM. So, I concluded that it must have been the usb drive that somehow got corrupted. To test this, I created a FAT32 formatted usb memory stick with some music that had file names with non-ASCII characters. I was expecting that mpd/GMPC would be able to read these properly and allow me to play them, just like the initial set up. I was wrong. These files were not visible and could not be played. As a further test, I created an ext formatted usb memory stick with the same music files. Now mpd/GMPC could see the files and I could play them. Aterm displays these files with two question marks, ??, in place of the non-ASCII characters. Within GMPC, the non-ASCII characters are displayed properly. For the FAT32 formatted stick or disk, aterm displays only one question mark, ?, in place of the non-ASCII characters. These files are not listed by GMPC.
Through all this, I have not altered the default Tiny Core locale, which is set to language C. I have read that linux is 'unicode aware', even when language is set to C and it is not necessary to set up as utf8.
A solution is to format the external usb drive as ext and copy the music to it (I will probably do this).
However, computers follow logic and I would like to understand a bit about character encoding and locales. My questions:
1. Why I was able to play music with non-ASCII file names from a FAT32 disk until I mounted that disk as a cifs network drive.
2. Why are non-ASCII file names on the 'new' FAT32 memory stick not handled in a way that mpd/GMPC can use them.
3. What is the appropriate way to do a cifs mount with TC when file names contain non-ASCII characters.