VFAT codepage and iocharset

As I mentioned, I have limited Internet access. It is now Monday and I am revisiting the Perenjori Telecentre, using their public Internet service.

On Friday I posted about a problem with iocharset=utf8. Well, here is a quote from some online docs (author: Christian Paratschek):

International (e.g. non-english) users may want to set their according codepage ("codepage=850" for German users as an example). This is important to keep correct special characters in the filenames of said shortname files. In practice, keeping the standard, "codepage=437" should be fine because the majority of the filenames are long ones anyway and these are stored in unicode. With the standard mount parameter "iocharset=iso8859-1" these are transformed into 8-bit filenames.


If you want to assign something different from the default, create an entry in /etc/fstab, like this:

/dev/sda1 /mnt/sda1 vfat shortname=mixed,codepage=850,umask=002,uid=1000,gid=100,noauto,user 0 0

There is a mail-list-thread where I found some discussion and it was found that iocharset=utf8 can cause errors. An example was given where it upset 'rsync'. Here is one example that was given (author: Richard Downer):

mkdir foo <-- OK
cp bar Foo/bar <-- ERROR
On FAT this is should be valid - but in this case it is not.


Here is another quote (author: Richard Downer):

(v)fat operates with two filenames, the short (8.3) msdos filename
and the long filename.
The short filename is handled via the "codepage=XXX" which is 850 in my case
living in dk-land. But since I don't use national characters in short
filenames I go with the default which is codepage=437 ~ ascii.
The long filename is stored in unicode and handled via "iocharset=isoXXXXX",
in my case "iso8859-1", the default.

So my mount line is:
/dev/hda1 /mnt/win_c vfat defaults,user,umask=0 0 0

I could have used
/dev/hda1 /mnt/win_c vfat
defaults,user,umask=0,iocharset=iso8859-1,codepage=850 0 0


What all of the above is indicating to me is that I should stay with 437 and iso8859-1, and anybody who wants different can edit /etc/fstab. But, it seems the problem is only with short-names, so it hardly seems to be much of an issue. If you are European and do have problems with long filenames, perhaps iso8859-2 would help?


Posted on 18 May 2009, 9:45


Comments:

Posted on 18 May 2009, 16:45 by Leon
Adjusting fstab settings solves the problem
It seems that staying with 437 and iso8859-1 is right decision.

I tried the suggested solution in Puppy 4.1.2 and it works fine for sl_SI locale. (Central European ISO-8859-2 character encoding)

It works for short (less or equal 8 characters) as well as for long (more then 8 characters) filenames.

I modified an entry in /etc/fstab

from:
/dev/hda8 /mnt/hda8 vfat shortname=mixed 0 0

to:
/dev/hda8 /mnt/hda8 vfat shortname=mixed,codepage=850 0 0

This adjustment could be a part of Chooselocale country localisation and probably pmount script.

Thanks for exploring the problem and finding the solution.



Posted on 20 May 2009, 9:23 by BarryK
Re: vfat codepage
Yes, I'll look into building it in automatically to the Puppy infrastructure.