Koozali.org: home of the SME Server

filenames with accents on mounted windows share not displaying correctly.

Offline quayph

  • 13
  • +0/-0
Hi all,

I am mounting a Windows2008 share with the following command :
Code: [Select]
mount -t cifs //xxx.xxx.xxx.xxx/admin /mnt/admin -o iocharset=iso8859-1,username=sauvegarde,password=xxxxxxx,dom=xxxxxxx.localFilenames with accented characters appear incorrectly. For example, the file Détail.PDF on the windows box shows as Deªutail.PDF

I have tried with and without the iocharset=iso8859-1 option.
When I try iocharset=utf-8 it throws an error about not having the correct libraries.

Does anyone have any ideas?
Thanks in advance,
Keith

Offline purvis

  • ****
  • 567
  • +0/-0
I had wrote a windows  program that would scan files for long file names and I thought for also characters I did not want.
Would you like to have the program.
I would likely need to recode it to allow for edititing of acceptable characters.
Basically I think you give it a drive or directory and it will scan all files from that location and any subdirectories of the location.
It runs in console mode and you can redirect the output to a file.
The output is any file not meeting your length or character choices.
« Last Edit: July 10, 2013, 01:48:09 PM by purvis »

Offline quayph

  • 13
  • +0/-0
Thanks for the offer, but unfortunately I can't go changing the filenames, or backing them up by hand.

I'm sure that the problem is characterset or Locale related.
By the way, My SME-8 box and the windows server are set up in french.
« Last Edit: July 10, 2013, 05:04:48 PM by quayph »

Offline _alex

  • ***
  • 103
  • +0/-0
Have You tried with:
Code: [Select]
iocharset=utf8
You may also need to add this to your ~/.bashrc:
Code: [Select]
export LANG=fr_FR.utf8
and logout and login again

Offline quayph

  • 13
  • +0/-0
I've launched an fsck on the disk so I'll have to try this tomorow.

The disk is mounted at boot time. So should I edit .bashrc for root?

Offline _alex

  • ***
  • 103
  • +0/-0
Not yet.

first remount the cifs share with iocharset=utf8. It may be enough. However, if funny filenames are still displayed, you may need to additionally edit ~/.bashrc of the user you are using, it may be root.

Offline quayph

  • 13
  • +0/-0
I tried
Code: [Select]
mount -t cifs //xxx.xxx.xxx.xxx/admin /mnt/admin -o iocharset=utf-8,username=sauvegarde,password=xxxxxxx,dom=xxxxxxx.localand got
Code: [Select]
mount error 79 = Can not access a needed shared library
Then I updated /root/.bashrc
Code: [Select]
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

export LANG=fr_FR.utf8

I logged out then back in. Still the same error message.

I have noticed that when mounting with iso8859-15 some of my accented characters show correctly. Some don't.

I can't really devote much more time to this problem. I guess that I'll have to live with wierd characters in the backup filenames.

Thanks for your efforts Alex.

Offline _alex

  • ***
  • 103
  • +0/-0
it's "iocharset=utf8", not "iocharset=utf-8"

Offline purvis

  • ****
  • 567
  • +0/-0
Does a backup program make the change of characters.
I had a comerical backup program back in the dos days do that to me.
I got ride of the program. It is better to catch these thigs up front rather than when you have to restore files.