Hermit
Joined: 27 May 2008 Posts: 2
|
Posted: Thu Jun 05, 2008 8:05 pm Post subject: COFS does support special characters (Unicode) in filename |
|
|
During installation we're asked whether to use COFS or Samba to access the Windows partition. Only Samba has support for special characters in filenames. Actually I did have files like that (Unicode filenames with non-Latin characters), but since I didn't have file and printer sharing enabled on my Windows setup (for security reasons), I had to choose COFS, thinking those files would not be read correctly.
Then I read that COFS has added Unicode support since version 0.7.1, so I decided to try it. I put the following line in /etc/fstab to try to mount the Windows partition with UTF-8 translation:
/dev/cofs0 /mnt/win cofs defaults,nls=utf8 0 0
After reboot, sure enough, the file system failed to mount, an error about invalid mount option, bad superblock, or missing nls charset. I suspect since the coLinux kernel was compiled without UTF-8 support, it couldn't find a valid NLS charset.
So I removed the nls=utf8 option and mounted the file system normally. Then for some reason I tried to remount with UTF-8 translation:
mount -o remount,nls=utf8 /mnt/win
It actually succeeded and mounted the file system in UTF-8 charset! I don't know why it failed to mount with utf8 in /etc/fstab and succeeded later. Maybe by the second time some needed module has been loaded? Anyway, I put the remount in rc.local and proceeded to the next step.
Once you get the file system mounted in UTF-8 charset, the rest becomes easy. You have to use a UTF-8 locale and/or tell KDE to expect UTF-8 filenames. I think KDE is supposed to use UTF-8 filenames if the locale is UTF-8, GNOME does so regardless of the locale.
I added these two line to /etc/environment
| Code: | LANG="en_US.UTF-8"
KDE_UTF8_FILENAMES=1 |
Now KDE applications should be able to open files with UTF-8 filenames. Obviously you need to install the necessary fonts to display the characters you're using and setup fontconfig with the necessary font substitution preference. That topic is a separate discussion and there are many examples on freedesktop.org.
Maybe we can add this as one of the tips on the Wiki? |
|