I own an Apple Macbook Pro laptop with 64-bit OS X 10.11 "El Capitan" running Samba 3 that I installed through Macports.
I also own a Dell Inspiron laptop with 64-bit GNU/Linux XUbuntu 16.04 "Xenial Xerus" running Samba 3 that I installed through APT.
Both machines have network-shared folders and use Samba in order to communicate on my WLAN (wireless LAN).
Both my systems are in Brazilian Portuguese. Thus, I use special characters such as ç, á, ã, â, ô, é, ó et cetera.
When I use my Linux laptop to access my OS X Samba shares, all strings are shown correctly: words like maçã, ônus and bênção are shown correctly. Files and folders with long names are also shown, and their names are shown correctly. Thus, the Samba server running on OS X is already properly configured...
...but things weren't working the other way around: if I used the Finder app on OS X to access my Linux Samba shares, all files and folders having at least one of those special characters were not shown (they remained invisible to me), and the long names of files and folders were converted to weird short names. Thus, there was something wrong with the Samba server running on my Linux machine.
=> In my case, what solved this issue was adding the following lines to the [global]
section inside the smb.conf
file on my Linux machine:
mangled names = no
dos charset = CP850
unix charset = UTF-8
After that, I opened a shell terminal window and restarted the Linux Samba server with this command:
sudo service smbd restart
...which can be replaced by this other command (in case the command above doesn't work on your Linux distribution):
sudo systemctl restart smbd.service
After I restarted the Linux Samba server, the Finder app on OS X finally showed correctly all the files and folders that were previously hidden because of their names having one or more special characters. The mangled ("shortened") names were also "unmangled".
Footnotes:
- In GNU/Linux systems, the standard location of the
smb.conf
file is /etc/samba/smb.conf
- Presuming that your Linux system has the
smb.conf
file stored at the standard location /etc/samba/
: there are several different ways to edit the smb.conf
file. For instance, if you're not using a Desktop Environment (e.g. your system has only a shell terminal, no windows) you can install the Nano text editor, by issuing a command such as sudo apt-get install nano -y
or sudo dnf -b -y install nano
or something else (depending on which Linux distro you are using), and then run sudo nano /etc/samba/smb.conf
. In case you're using a Desktop Environment, you can install a graphical text editor such as GNOME Edit, by issuing a command such as sudo apt-get install gedit -y
or sudo dnf -b -y install gedit
or something else (depending on which Linux distro you are using), and then run sudo gedit /etc/samba/smb.conf
.
- In Samba 3+, the
display charset
parameter is deprecated.
- The
dos charset
parameter does not support the UTF-8
argument. Thus, it must use the default argument CP850
.
mangled names = no
instructs the Samba server not to shorten long names of files and folders. Hence, because the Samba client just replicates to the user what the Samba server has provided to the client, once the server is properly configured the client will no longer show the user any shortened name.