Solved Samba character encoding

Hi,

I'm experiencing some problems with character encoding on a Samba-4.4 server. The problem is that not all files are shown, unless I'm setting unix charset to iso8859-1, instead of the default UTF-8.

The problem is that I have to regularly sync files from a remote server, via FTP. The remote server is a Windows-server and the FTP-sharing is done via IIS. I do this by mounting the remote FTP-server with curlftpfs and sync all the files to a directory on my server with rsync. The directory on my server is shared via Samba-4.4. This seems to work fine, since all the files are present on my server, after the sync is complete. However, the problem is that not all files in that share are visible on the clients, unless I set unix charset to iso8859-1 in smb4.conf. This problem is encountered in Windows, MacOS and Linux clients, btw.

As soon as I set unix charset to iso8859-1, all works fine. But something doesn't sit right with me, because the setting unix charset should be telling Samba what the charset is, that FreeBSD is using. And that's set to UTF-8. Not ISO-8859-1.

Code:
[me@server ~]$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE=C
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

Is it safe to use iso8859-1, or is this going to be a problem in the long run? Since it's a global setting, it affects all my shares. Not just the one I'm having a problem with. Maybe I'm not understanding this thing correctly, I don't know. So any help or explanation is most appreciated.

Thanks!
 
Is it safe to use iso8859-1, or is this going to be a problem in the long run?

Well, of course it was going to create problems. It resulted in files in all the other shares becoming invisible. Basically flipping the problem around. Why keeps stuff like this biting us in he ass?

The silver lining is that at least I knew where the problem was. And eventually I managed to fix it. First I mounted the share with the correct encoding. After that, I ran rsync with the iconv option, to convert the files, while syning. Make sure to install converters/iconv, to make that work.

Code:
curlftpfs 123.123.123.123:21 /FTP_mount/ -o codepage=latin1 -o iocharset=utf8,user=username:password,umask=000,allow_other

rsync -rltDv --iconv=latin1,utf-8 /FTP_mount/ /path/to/destination/
 
Back
Top