# Samba: missing umlauts in client



## Thorny (Dec 6, 2011)

Hello,

I have a Samba share, which has the following global char-set definition in smb.conf:

```
# Charset settings
display charset = cp1252
unix charset = utf-8
dos charset = cp866
```

Now I want to mount a share of the server with mount_smbfs. This works, but after mounting, all umlauts are missing in the output. For example:

```
#  mount_smbfs -I 192.168.23.225 -E utf-8:cp1252 //thorny@192.168.23.225/home /home/thorny/mount/home/
```

An `ls -lah` gives me this result:

```
drwxr-xr-x  1 thorny  thorny    16K  1 Jan  1970 .
drwxr-xr-x  9 thorny  thorny   512B  6 Dez 14:05 ..
-rwxr-xr-x  1 thorny  thorny     0B  6 Dez 14:12 t
```

At the server, I get this result:

```
drwxr-xr-x  1 thorny  thorny    16K  1 Jan  1970 .
drwxr-xr-x  9 thorny  thorny   512B  6 Dez 14:05 ..
-rwxr-xr-x  1 thorny  thorny     0B  6 Dez 14:12 tÃ¤st.txt
```

My client locales are:

```
# locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_ALL=de_DE.UTF-8
```

My server locales are:

```
# locale 
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_ALL=
```

I tried different charset combinations, but nothing worked. Now I believe that I have a big missunderstanding of the problem. Can anyone give me a hint? 

Thanks for your time and help,
Thorny


----------



## SirDice (Dec 6, 2011)

The console isn't quite UTF-8 aware.

Thread 311


----------



## Thorny (Dec 7, 2011)

Sorry, i didn't get the point. You say the console is not UTF-8 aware. Okay, but the server and the client are both FreeBSDs. Why could i see all umlauts at the server, but not at the client?
Also: if i mount from another FreeBSD, i get the following output:

```
drwxr-xr-x  1 thorny  thorny    16K  1 Jan  1970 .
drwxr-xr-x  9 thorny  thorny   512B  6 Dez 14:05 ..
-rwxr-xr-x  1 thorny  thorny     0B  6 Dez 14:12 t??st.txt
```

That is far better. 

In the linked thread was posted, that it just doesn't work at the console, but all GUI-programms should work correctly. I testet it, but this isn't the case for me.

Any hints?


----------



## kpa (Dec 7, 2011)

Set the locale(1) properly on the client, this should do the trick (tcsh):

`$ setenv LC_ALL en_US.UTF-8`


----------



## Thorny (Dec 7, 2011)

I already have:

```
LC_ALL=de_DE.UTF-8
```

This doesn't work. I can see/use all german umlauts at the client. But i can't see umlauts at the mounted samba-share. 

Greetings,
Thorny


----------



## kpa (Dec 7, 2011)

I think you need 
	
	



```
display charset = utf-8
```
 in smb.conf.


----------



## Thorny (Dec 8, 2011)

kpa said:
			
		

> I think you need
> 
> 
> 
> ...



Tested a minute ago. Didn't work


----------



## mix_room (Dec 9, 2011)

Have you tried without the cp1252 extensions? Just running everything over plain utf-8?


----------



## kpa (Dec 9, 2011)

Yeah, the console does not support UTF-8 properly. Do you have to use the console on the client machine or were you just testing on it? If you use a terminal emulator like Putty the UTF-8 file names should display correctly.


----------



## peetaur (Dec 10, 2011)

I had the same problem (with a Linux or Windows client).


```
$ ls /some_nfs_share
testÃ¶Ã¤Ã¼ÃŸ
$ ls /some_samba_share
test????
```


Then on the server, I added 
	
	



```
display charset = utf-8
```
 as suggested above, which didn't fix it.

Then I added 
	
	



```
iocharset=utf8
```
 in the mount options on the Linux client (mount.cifs), which seemed to work. However, I don't see that option in the FreeBSD client (mount_smbfs) man page. Maybe this is the same thing, but I don't have a FreeBSD client up right now to test:

```
-E cs1:cs2
        Specifies local (cs1) and server's (cs2) character sets.
```


----------



## Thorny (Dec 12, 2011)

mix_room said:
			
		

> Have you tried without the cp1252 extensions? Just running everything over plain utf-8?


Yes. This doesn't work either.



			
				kpa said:
			
		

> Yeah, the console does not support UTF-8 properly. Do you have to use the console on the client machine or were you just testing on it? If you use a terminal emulator like Putty the UTF-8 file names should display correctly.


As i stated above: this is not a console problem. No GUI could display the umlauts. I also tested it with putty: it does not work 

@peetaur
My exact problem. I also have a Linux here, which displays the umlauts correctly after defining the iocharset. But i already tried the -E flag in various ways, but nothing works.


----------



## Thorny (Dec 12, 2011)

Problem solved  At the weekend, i wrote a little script, which tests the various configurations of samba and the mounting-options automatically. 

First i must change the dos charset in smb.conf, because the FreeBSD client use this charset and not the unix-charset when mounting. 


```
# Charset settings
   display charset = cp1252
   unix charset = utf-8
   dos charset = cp1252
```

My locales are correct:

```
# locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_ALL=de_DE.UTF-8
```

And now the same mount-command works:

```
#  mount_smbfs -I 192.168.23.225 -E utf-8:cp1252 //thorny@192.168.23.225/home /home/thorny/mount/home/
```

Result for ls -lah:

```
drwxr-xr-x  1 thorny  thorny    16K  1 Jan  1970 .
drwxr-xr-x  9 thorny  thorny   512B  6 Dez 14:05 ..
-rwxr-xr-x  1 thorny  thorny     0B  6 Dez 14:12 tÃ¤st.txt
```

Thanks for all hints and your time,
Thorny


----------

