henry j. mason
2005-Oct-31 18:36 UTC
[Samba] unicode/control characters displaying as ? with cifsfs
greeting samba.general; i am trying to set up a backup server to archive files from a windows 2000 fileserver, and i can't seem to get filenames containing non-ascii characters to appear correctly on the linux box. my windows server: windows 2000 service pack 4 my linux server: debian 3.1 kernel 2.6.13.3 with these options: CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set # CONFIG_CIFS_XATTR is not set # CONFIG_CIFS_EXPERIMENTAL is not set samba 3.0.14a-3 my mount command looks like this: mount -t cifs //YCS1610-767/Jobs /mnt/prinergy/jobs/ -o username=imageserver,password=xxx listing a typical directory: admin@mpi-images:~$ ls "/mnt/prinergy/jobs/ System 5 Bearer Bars/" 57686e_f.srd Icon? System 5 bottom bearer.ai6 System 5 top bearer.ai6 when i try to copy the "Icon?" file, it will fail with: admin@mpi-images:~$ cp "/mnt/prinergy/jobs/ System 5 Bearer Bars/Icon?" /tmp cp: cannot stat `/mnt/prinergy/jobs/ System 5 Bearer Bars/Icon?': No such file or directory obviously this is a problem. according to what i can find online, cifsfs is supposed to handle unicode correctly, yet it doesn't seem to be working. fwiw the same mount command using "mount -f smbfs" exhibits the same behaviour. any suggestions? tia henry
henry j. mason
2005-Nov-01 17:09 UTC
[Samba] Re: unicode/control characters displaying as ? with cifsfs (SOLVED)
henry j. mason wrote:> greeting samba.general; > > i am trying to set up a backup server to archive files from > a windows 2000 fileserver, and i can't seem to get filenames > containing non-ascii characters to appear correctly on the > linux box.after some more digging on the web, i found that i need to generate a UTF-8 character set encoding. by default, debian only comes with a bare minumum, and the default charset happens to be en_US.iso88591 - which doesn't match the UTF-8 encoding used by windows. so, to do this under debian (as root): mpi-images:~# dpkg-reconfigure locales scroll down until you see the UTF-8 encoding for your locale, in this case, en_US.UTF-8. select the encoding, and choose 'Ok'. debian will generate the locales for you. check their existence with: mpi-images:~# locale -a C POSIX en_US en_US.iso88591 en_US.utf8 then, the magic mount command is: mpi-images:~# mount -t cifs //YCS1610-767/Jobs /mnt/prinergy/jobs/ -o username=imageserver,password=xxx,iocharset=utf8 now, when i list that same directory: admin@mpi-images:~$ ls -l "/mnt/prinergy/jobs/ System 5 Bearer Bars/" total 592 -rwxrwSrwt 1 root root 537856 2004-01-05 10:24 57686e_f.srd -rwxrwSrwt 1 root root 0 2003-06-19 13:14 Icon? -rwxrwSrwt 1 root root 32455 2003-07-09 14:05 System 5 bottom bearer.ai6 -rwxrwSrwt 1 root root 32242 2003-07-09 14:06 System 5 top bearer.ai6 the stupid control character shows up correctly as whatever it is. and the copy command executes happily: admin@mpi-images:~$ cp "/mnt/prinergy/jobs/ System 5 Bearer Bars/Icon?" /tmp/ admin@mpi-images:~$ voila! hope this helps someone else :) regards, henry