Jump to content

Samba: special characters in filenames disappear


tlahtopil
 Share

Recommended Posts

As an Spanish-speaking user, every time I have to install Samba I find that my accented vowels and 'ñ' dissapear when browsing smb-servers in Windoze Explorer or Crapintosh Finder, same as I've read happens to German-speaking users with umlauts ans ess-tset. So, if you use a Latin-based alphabet, here's my recipe:

 

1. Set your global environment encoding to ISO8859-1 (I use Konqueror > Preferences > Configure > Fonts; notice this may not work with other environs, text or graphic, but KDE is the one and almost only for me).

2. Find and edit (maybe as root) smb.conf; don't ask me where it lives, I'm an almost-newbie, so perform a local search and edit it with the tool you feel most comfortable; I suggest Swat or Webmin, better the former.

3. Write these values in "[global]" (literaly; copy-paste this if you want):

 

[global]

dos charset = CP850

unix charset = iso8859-1

display charset = LOCALE

 

In Swat, go to Globals > Advanced, type those values and click on "Commit".

 

4. Save smb.conf and restart Samba.

 

I don't assure it will work for you, I don't even know if it works the same in all Samba versions, but there is where I head to every time I have to setup a new Samba server. As far I've read in forums, the main thing is to first tie your environment to a concrete encoding, so don't ever let that line blank or as "environment default", "local language default", etc.

 

For Latin based alphabets, always try first ISO8859-1 in your environment and "Unix charset", if that doesn't work, try ISO8859-15, and if that either, ISO8859-13. Last resorces are ASCII and CP-850 (this may be needed if you have a disk with very old DOS partitions or old-DOS-long-filenames, but your Ext-2/3 partitions may then suffer).

 

If you're working on a multiboot PC with preexisting Windoze partitions, don't install your *n*x with "Unicode as default", 'cause that will mess all their special-char-filenames (well, they remain ASCII or CP850 correct, but *n*x won't translate them well, and if you retype them, then WExplorer will also scramble the Unicode chars).

 

As far as I've experienced, the holy grial of correct encode-mangling is to first install *n*x on a fresh new PC with "Unicode as default", later install Windoze (NT family is less-worse) and also pick Unicode as default, and then, afer a good reboot, begin creating special-char filenames. Removable FAT, FAT32 and NTFS media should be expected to have ISO8859-15 encoding, which you can configure in Drakconf.

 

 

Good luck.

Edited by tlahtopil
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...