Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Samba mount files don't show swedish characters
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Seron
Apprentice
Apprentice


Joined: 31 Dec 2002
Posts: 293
Location: Malmö, Sweden

PostPosted: Mon Dec 29, 2003 11:09 am    Post subject: Samba mount files don't show swedish characters Reply with quote

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
Code:
mount -t smbfs -o username=myun,password=mypw //server/share /mnt/samba


How can I correct this?

Seron
Back to top
View user's profile Send private message
Kompi
Apprentice
Apprentice


Joined: 05 Oct 2002
Posts: 252
Location: Germany

PostPosted: Mon Dec 29, 2003 12:52 pm    Post subject: Reply with quote

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,
like iso8859-1. (Note: only kernel 2.4.0 or later)

codepage=<arg>
sets the codepage the server uses. See the iocharset option.
Example value cp850. (Note: only kernel 2.4.0 or later)

Probably you have to compile the right nls-module with your kernel, I don't know exactly.
Back to top
View user's profile Send private message
Seron
Apprentice
Apprentice


Joined: 31 Dec 2002
Posts: 293
Location: Malmö, Sweden

PostPosted: Mon Dec 29, 2003 2:27 pm    Post subject: Reply with quote

I tried this, but it didn't work :

Code:
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"
Back to top
View user's profile Send private message
Kompi
Apprentice
Apprentice


Joined: 05 Oct 2002
Posts: 252
Location: Germany

PostPosted: Mon Dec 29, 2003 2:55 pm    Post subject: Reply with quote

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:
Code:
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)
Back to top
View user's profile Send private message
Seron
Apprentice
Apprentice


Joined: 31 Dec 2002
Posts: 293
Location: Malmö, Sweden

PostPosted: Mon Dec 29, 2003 5:21 pm    Post subject: Reply with quote

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
Code:
client code page = 850
character set = ISO8859-1
under global but it didn't work.
Back to top
View user's profile Send private message
jonaswidarsson
Apprentice
Apprentice


Joined: 16 Jan 2004
Posts: 273
Location: Göteborg, Sweden

PostPosted: Sun Mar 28, 2004 4:29 pm    Post subject: Reply with quote

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

Look at the example from my upgrade:
Code:
#   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.
Back to top
View user's profile Send private message
jonaswidarsson
Apprentice
Apprentice


Joined: 16 Jan 2004
Posts: 273
Location: Göteborg, Sweden

PostPosted: Sun Mar 28, 2004 4:31 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
sethleon
Guru
Guru


Joined: 14 Dec 2003
Posts: 398
Location: Germany

PostPosted: Sat Apr 03, 2004 9:33 pm    Post subject: Reply with quote

I just found out something, :D
setting the following enables full UTF-8 support
for file names in samba including unicode chars (ü,ö,ä,...,вааывафы):
in /etc/samba/smb.conf:
Code:
dos charset = uft8
unix charset = utf8

_________________
Mess with the best, die like the rest.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum