andLinux Homepage andlinux.org
The official forum of the andLinux community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Please help to keep the forum clean! Seen a post that is spam or contains objectionable material?
Please report the link to the post to: david @ andlinux . org (remove spaces)

COFS does support special characters (Unicode) in filename

 
Post new topic   Reply to topic    andlinux.org Forum Index -> Accessing Windows via COFS
View previous topic :: View next topic  
Author Message
Hermit



Joined: 27 May 2008
Posts: 2

PostPosted: Thu Jun 05, 2008 8:05 pm    Post subject: COFS does support special characters (Unicode) in filename Reply with quote

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?
Back to top
View user's profile Send private message Visit poster's website
stas



Joined: 07 Jun 2010
Posts: 1
Location: Warsaw, Poland

PostPosted: Mon Jun 07, 2010 9:41 pm    Post subject: Reply with quote

This is a great tip. I was struggling (unsuccessfully) to set up samba mounts and just couldn't figure it out. Came across your post and the problem is now solved Smile

Thanks so much. I'd love to see this being added to the wiki!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    andlinux.org Forum Index -> Accessing Windows via COFS All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group