Cifs - Windows/Ubuntu - Encoding Problem

Status
Not open for further replies.

Dominik K.

Cadet
Joined
Mar 14, 2017
Messages
2
Hello,

we are using samba for sharing on FreeNAS 9.10.2-U1 and are encountering problems with the encoding.
On windows everything shows fine, but on FreeNAS and Ubuntu the file and directory names are different.
We use a special sign (middle dot) sometimes which seem problematic:
cifs_encoding_windows.png

I am guessing Windows is using UTF-16 (I read NTFS uses UTF-16), but our other machines are using UTF-8.
I also looked a little bit into UTF-16 for ubuntu, but it seems not possible?

I appreciate any hints or solutions.


Some machines from which I tried to get the encoding to work:


Ubuntu VM under Hyper V
Linux igp-gds 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

locale:
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

fstab entry:
//192.168.0.8/IGP /mnt/192.168.0.8-igp cifs username=abc,password=xyz,iocharset=utf8,file_mode=0444,dir_mode=0555 0 0

root@igp-gds:/mnt/192.168.0.8-igp/1291 - Hotelumbau Mallorca/Server/17. Haustechnik A. Bösett# cd Endfassung\ Listen\ A.Bö\ /
(after Bö is a newline \n, therefore ls does not work there)

hexdump:
00000000 45 6e 64 66 61 73 73 75 6e 67 20 4c 69 73 74 65 |Endfassung Liste|
00000010 6e 20 41 2e 42 c3 b6 20 2f 0a |n A.B.. /.|
0000001a




Ubuntu
Linux Ubuntu 4.8.0-36-generic #36-16.04.1-Ubuntu SMP Sun Feb 5 09:39:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

mount -t cifs //192.168.0.8/IGP /mnt/igp -u username=abc,password=xyz,iocharset=utf8

root@ubuntu:/mnt/igp/1291 - Hotelumbau Mallorca/Server/17. Haustechnik A. Bösett# cd Endfassung\ Listen\ A.Bö\ /

hexdump:
00000000 45 6e 64 66 61 73 73 75 6e 67 20 4c 69 73 74 65 |Endfassung Liste|
00000010 6e 20 41 2e 42 c3 b6 20 2f 0a |n A.B.. /.|
0000001a




SSH into FreeNAS (FreeNAS 9.10.2-U1)
FreeBSD samba.intern.igp-ag.com 10.3-STABLE FreeBSD 10.3-STABLE #0 41eb257(9.10.2-STABLE): Mon Mar 6 17:03:14 UTC 2017 root@gauntlet:/freenas-9.10-releng/_BE/objs/freenas-9.10-releng/_BE/os/sys/FreeNAS.amd64 amd64

locale:
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

[root@samba /mnt/vol1/IGP/1291 - Hotelumbau Mallorca/Server/17. Haustechnik A. Bösett]# Endfassung\ Listen\ A.B?????

with tab completion
[root@samba /mnt/vol1/IGP/1291 - Hotelumbau Mallorca/Server/17. Haustechnik A. Bösett]# Endfassung\ Listen\ A.B\303\266\357\200\251/

hexdump:
00000000 45 6e 64 66 61 73 73 75 6e 67 20 4c 69 73 74 65 |Endfassung Liste|
00000010 6e 20 41 2e 42 c3 b6 ef 80 a9 2f 0a |n A.B...../.|
0000001c



Windows via Network
cifs_encoding_windows.png


hexdump (HxD):
00000000 45 6E 64 66 61 73 73 75 6E 67 20 4C 69 73 74 65 |Endfassung Liste|
00000010 6E 20 41 2E 42 94 3F 0D 0A |n A.B”?..|
 

Dominik K.

Cadet
Joined
Mar 14, 2017
Messages
2
Unfortunetely I was not able to. I just ended up renaming a bunch of files with the problematic character in Windows, which I located through a script (as the directories appear empty to php if it cannot open it properly).
 
Status
Not open for further replies.
Top