New firmware version, new issues – and new points to think about.
If you often login to your NAS shell you might have seen weired letters (applies to special characters like German Umlauts and other language-specific letters) using ls or dir to display the folder content. This results from different character set used by Samba clients and linux itself. Most NAS devices might use UTF-8 as characterset for the filesystem whereas Windows clients use CP850 and MAC clients also use UTF-8.
If you are editing files directly from the NAS with an editor which checks for changes of this files you might have troubles after saving the file with this editor and afterwards asking you if it should use the “updated” version. This is due to time differences between server (NAS) and client. So the goal is to keep both synchronized.
What can you do to change this? You need to do the following steps:
1. change the settings for Samba
2. translate / convert existing filenames into the new character set
Please first check the last point! Maybe you only need to change the character encoding of your SSH client to display the filenames correctly!
So let us just go through these two simple sounding steps.
1. CHANGING SAMBA SETTINGS
- Edit smb.conf (usually located in /etc ; /etc/samba OR /etc/smb – on QNAP NAS systems use /etc/config/smb.conf) by typing something like
vim /etc/config/smb.conf
- Look for the old value for dos charset or something similar and replace with / add the folowing values:
dos charset = CP850
unix charset = UTF8
display charset = UTF8
time server = yes
dos charset is the character set used by your windows client. You should set it to CP850.
unix charset is the character set used by the linux on your NAS. Often UTF8, might also be ISO 8859-1.
display charset is the character set used in Samba messages (i.e. error messages). You might use UTF-8 as display characters set on your linux box.
time server sets the Samba server as source for time synchronization.
- Restart samba using something like (this is not really necessary as Samba should pull the new configuration but it is good to know that it uses the new configuration NOW):
/etc/init.d/smb.sh restart
2. CONVERT EXISTING FILENAMES
- Be sure perl is installed – if not you should install it. On QNAP NAS and similars use ipkg:
ipkg install perl
- Get the latest version of convmv and extract it (first change to a folder where you want to extract the tool, e.g. your home directory):
wget http://www.j3e.de/linux/convmv/convmv-1.14.tar.gz
tar xzvf convmv-1.14.tar.gz
cd convmv*
- You can now use convmv to convert filenames between different encodings. It might be interesting to first check the conversion with some examples (go to a folder where files or folders with special characters are located and use convmv WITHOUT –notest to just display the changes, when using –notest all changes are written to disk). Here is an example for first converting old CP850 dos filenames to UTF-8:
/root/convmv-1.14/convmv -r -f cp850 -t utf8 * --notest
Be aware that this is a full recursive conversion!
And now play a little bit around with special character filenames. If you check the filename in the filesystem using a client like putty please keep in mind that the SSH client tool should display the content in UTF-8. (in putty use Change Settings / Load Profile and change the translation in Window -> Translation to UTF-8)
Any feedback is appreciated!

