5 <firstname>TAKAHASHI</firstname><surname>Motonobu</surname>
7 <address><email>monyo@home.monyo.com</email></address>
10 <pubdate>25 March 2003</pubdate>
13 <title>Unicode/Charsets</title>
16 <title>Features and Benefits</title>
19 Every industry eventually matures. One of the great areas of maturation is in
20 the focus that has been given over the past decade to make it possible for anyone
21 anywhere to use a computer. It has not always been that way, in fact, not so long
22 ago it was common for software to be written for exclusive use in the country of
27 Of all the effort that has been brought to bear on providing native language support
28 for all computer users, the efforts of the <ulink url="http://www.openi18n.org/">Openi18n organisation</ulink> is deserving of
33 Samba-2.x supported a single locale through a mechanism called
34 <emphasis>codepages</emphasis>. Samba-3 is destined to become a truly trans-global
35 file and printer sharing platform.
41 <title>What are charsets and unicode?</title>
44 Computers communicate in numbers. In texts, each number will be
45 translated to a corresponding letter. The meaning that will be assigned
46 to a certain number depends on the <emphasis>character set(charset)
47 </emphasis> that is used.
48 A charset can be seen as a table that is used to translate numbers to
49 letters. Not all computers use the same charset (there are charsets
50 with German umlauts, Japanese characters, etc). Usually a charset contains
51 256 characters, which means that storing a character with it takes
52 exactly one byte. </para>
55 There are also charsets that support even more characters,
56 but those need twice(or even more) as much storage space. These
57 charsets can contain <command>256 * 256 = 65536</command> characters, which
58 is more then all possible characters one could think of. They are called
59 multibyte charsets (because they use more then one byte to
64 A standardised multibyte charset is <ulink url="http://www.unicode.org/">unicode</ulink>.
65 A big advantage of using a multibyte charset is that you only need one; there
66 is no need to make sure two computers use the same charset when they are
70 <para>Old windows clients use single-byte charsets, named
71 'codepages' by Microsoft. However, there is no support for
72 negotiating the charset to be used in the smb protocol. Thus, you
73 have to make sure you are using the same charset when talking to an older client.
74 Newer clients (Windows NT, 2K, XP) talk unicode over the wire.
79 <title>Samba and charsets</title>
82 As of samba 3.0, samba can (and will) talk unicode over the wire. Internally,
83 samba knows of three kinds of character sets:
88 <term><smbconfoption><name>unix charset</name></smbconfoption></term>
90 This is the charset used internally by your operating system.
91 The default is <constant>UTF-8</constant>, which is fine for most
92 systems. The default in previous samba releases was <constant>ASCII</constant>.
97 <term><smbconfoption><name>display charset</name></smbconfoption></term>
98 <listitem><para>This is the charset samba will use to print messages
99 on your screen. It should generally be the same as the <command>unix charset</command>.
104 <term><smbconfoption><name>dos charset</name></smbconfoption></term>
105 <listitem><para>This is the charset samba uses when communicating with
106 DOS and Windows 9x clients. It will talk unicode to all newer clients.
107 The default depends on the charsets you have installed on your system.
108 Run <command>testparm -v | grep "dos charset"</command> to see
109 what the default is on your system.
117 <title>Conversion from old names</title>
119 <para>Because previous samba versions did not do any charset conversion,
120 characters in filenames are usually not correct in the unix charset but only
121 for the local charset used by the DOS/Windows clients.</para>
123 <para>Bjoern Jacke has written a utility named <ulink url="http://j3e.de/linux/convmv/">convm</ulink> that can convert whole directory
124 structures to different charsets with one single command.
130 <title>Japanese charsets</title>
132 <para>Samba doesn't work correctly with Japanese charsets yet. Here are
133 points of attention when setting it up:</para>
137 <listitem><para>You should set <smbconfoption><name>mangling method</name><value>hash</value></smbconfoption></para></listitem>
139 <listitem><para>There are various iconv() implementations around and not
140 all of them work equally well. glibc2's iconv() has a critical problem
141 in CP932. libiconv-1.8 works with CP932 but still has some problems and
142 does not work with EUC-JP.</para></listitem>
144 <listitem><para>You should set <smbconfoption><name>dos charset</name><value>CP932</value></smbconfoption>, not
145 Shift_JIS, SJIS...</para></listitem>
147 <listitem><para>Currently only <smbconfoption><name>unix charset</name><value>CP932</value></smbconfoption>
148 will work (but still has some problems...) because of iconv() issues.
149 <smbconfoption><name>unix charset</name><value>EUC-JP</value></smbconfoption> doesn't work well because of
150 iconv() issues.</para></listitem>
152 <listitem><para>Currently Samba 3.0 does not support <smbconfoption><name>unix charset</name><value>UTF8-MAC/CAP/HEX/JIS*</value></smbconfoption></para></listitem>
156 <para>More information (in Japanese) is available at: <ulink noescape="1" url="http://www.atmarkit.co.jp/flinux/special/samba3/samba3a.html">http://www.atmarkit.co.jp/flinux/special/samba3/samba3a.html</ulink>.</para>
161 <title>Common errors</title>
164 <title>CP850.so can't be found</title>
166 <para><quote>Samba is complaining about a missing <filename>CP850.so</filename> file</quote>.</para>
168 <para>CP850 is the default <smbconfoption><name>dos charset</name></smbconfoption>. The <smbconfoption><name>dos charset</name></smbconfoption> is used to convert data to the codepage used by your dos clients. If you don't have any dos clients, you can safely ignore this message. </para>
170 <para>CP850 should be supported by your local iconv implementation. Make sure you have all the required packages installed. If you compiled samba from source, make sure configure found iconv.</para>