# Samba mount files don't show swedish characters

## Seron

Hello,

When I mount a windows XP share, files containing swedish characters åäö äre shown with question marks instead. I think there's a codepage mismatch. The codepage in windows is 437. I don't know what it is in linux.

I mount the share with 

```
mount -t smbfs -o username=myun,password=mypw //server/share /mnt/samba
```

How can I correct this?

Seron

----------

## Kompi

Look into the smbmount-manpage, there are the following options:

 *Quote:*   

>   iocharset=<arg>
> 
>               sets  the charset used by the Linux side for codepage to charset
> 
>               translations (NLS). Argument should be the name  of  a  charset,
> ...

 

Probably you have to compile the right nls-module with your kernel, I don't know exactly.

----------

## Seron

I tried this, but it didn't work :

```
mount -t smbfs -o username=un,password=pw,codepage=cp437,iocharset=iso8859-1 //server/share /mnt/samba
```

I think codepage should be cp437 but I don't know what iocharset should be. How can I find out which charset is used in linux?

I have the following in the kernel:

iso8859-1

cp437

cp850

cp865

and this is from rc.conf:

KEYMAP="se-latin1 euro2"

EXTENDED_KEYMAPS="backspace keypad"

CONSOLEFONT="lat9v-14"

----------

## Kompi

humn, I think iso-8859-1 should be the right. Others are for Languages with non-latin characters, bus these you need are included in iso-8859-1.

Did you try the other codepages? cp865 looks very suitable.

What you else can do is to look into the autoexec.bat of your windows installation. There should be lines like this:

```
mode con codepage prepare=((xxx) C:\WINDOWS\COMMAND\ega.cpi)

mode con codepage select=xxx
```

whereas the xxx is the number of the selected codepage.

 *Quote:*   

> How can I find out which charset is used in linux?

 

For _filesystems_ the one is used you specified in the kernel as default NLS (by default iso-8895-1), or the one you specify when mounting.

For _console_ output it depends on the CONSOLEFONT you entered in rc.conf.

(For X it has also an own mechanism through the different font charsets.)

So if you have configured the right codepage an charset at mount-time, there is also the possibility that filenames are read correctly, but the charset which is used in console does not contain these characters an cannot show it to your screen.

I don't know exaclty what your lat9v-14-Charset contain. Have a look at /usr/share/consolefonts/README.lat9 for detailed information. Probably you have to chose another consolefont out of this directory. (change in rc.conf)

----------

## Seron

It's solved! The mount was ok and after adding

export LANG="sv_SE"

at the command line, correct characters appeard, except for the euro symbol that gets mangled through samba but works localy. I didn't notice any differences if the codepage was set to 437 or 850.

I also made slight changes to the following:

CONSOLEFONT="lat9w-14"

CONSOLETRANSLATION="8859-15_to_uni"

8859-15 was compiled into the kernel

Thanks for your help!

I wonder if it's possible to put the options codepage=cp850,iocharset=iso8859-1 in smb.conf. I tried adding

```
client code page = 850

character set = ISO8859-1

```

under global but it didn't work.

----------

## jonaswidarsson

version samba  >= 3.0.0 has introduced new variable names in smb.conf for codepages:

Look at the example from my upgrade:

```
#   client code page = 850

#   character set = ISO8859-1

   dos charset = 850

   unix charset = ISO8859-1

```

I have a troublesome question of my own:

I have that samba server. It is the file server at the company office.

Right now I am testing gentoo on my laptop, and nobody else does linux here. So I am the only one. We are swedes (kålhuvuden... närå *fniss*), so we use åäö in our filenames.

The mysterious matter:

I use KDE. I set up lisa and started konqueror. I tried the smb://hostname/share thing and was very happy about how easily things started working. Then I noticed some folders were empty.

It appeared to me that any folder name with a scandinavian character in it cold not be fully browsed into. It is ok to go in there, but nothing shows up. The folder names look fine though.

I tried to change the setting for MS Windows encoding according to this screenshot:

http://ext.nineab.com/jonas/control-center-windows-shares.png

But it does not work.

So why do I run samba? I am in a local network and both server and this client is linux.

The simplest answer is that samba is already setup, and of course I think it should work? I mean, I do browse it! Just not into the folders with åäö.

Any ideas?

My linux server codepage settings are those mentioned in the top of this post and it works well both with WindowsXP, 2000 and Mac OS X.

----------

## jonaswidarsson

 *jonaswidarsson wrote:*   

> version samba  >= 3.0.0 has introduced new variable names in smb.conf for codepages:

  I was obviously talking about the server's configuration, Pardon me.

----------

## sethleon

I just found out something,   :Very Happy: 

setting the following enables full UTF-8 support

for file names in samba including unicode chars (ü,ö,ä,...,вааывафы):

in /etc/samba/smb.conf:

```
dos charset = uft8

unix charset = utf8
```

----------

