|
Using SambaRobert Eckstein, David Collier-Brown, Peter Kelly1st Edition November 1999 1-56592-449-5, Order Number: 4495 416 pages, $34.95 |
8.3 Internationalization
Samba has a limited ability to speak foreign tongues: if you need to deal with characters that aren't in standard ASCII, some options that can help you are shown in Table 8.3. Otherwise, you can skip over this section.
Table 8.3: Networking Configuration Options Option
Parameters
Function
Default
Scope
client code pageDescribed in this section
Sets a code page to expect from clients
850
Global
character setDescribed in this section
Translates code pages into alternate UNIX character sets
None
Global
coding systemDescribed in this section
Translates code page 932 into an Asian character set
None
Global
valid charsstring (set of characters)
Obsolete: formerly added individual characters to a code page, and had to be used after setting client code page
None
Global
8.3.1 client code page
The character sets on Windows platforms hark back to the original concept of a code page. These code pages are used by DOS and Windows clients to determine rules for mapping lowercase letters to uppercase letters. Samba can be instructed to use a variety of code pages through the use of the global
clientcodepageoption in order to match the corresponding code page in use on the client. This option loads a code-page definition file, and can take the values specified in Table 8.4.
Table 8.4: Valid Code Pages with Samba 2.0 Code Page
Definition
437MS-DOS Latin (United States)
737Windows 95 Greek
850MS-DOS Latin 1 (Western European)
852MS-DOS Latin 2 (Eastern European)
861MS-DOS Icelandic
866MS-DOS Cyrillic (Russian)
932MS-DOS Japanese Shift-JIS
936MS-DOS Simplified Chinese
949MS-DOS Korean Hangul
950MS-DOS Traditional Chinese
You can set the client code page as follows:
[global] client code page = 852The default value of this option is 850. You can use the make_smbcodepage tool that comes with Samba (by default in /usr/local/samba/bin) to create your own SMB code pages, in the event that those listed earlier are not sufficient.
8.3.2 character set
The global
charactersetoption can be used to convert filenames offered through a DOS code page (see the previous section, Section 8.3.1, client code page) to equivalents that can be represented by Unix character sets other than those in the United States. For example, if you want to convert the Western European MS-DOS character set on the client to a Western European Unix character set on the server, you can use the following in your configuration file:[global] client code page = 850 character set = ISO8859-1Note that you must include a
clientcodepageoption to specify the character set from which you are converting. The valid character sets (and their matching code pages) that Samba 2.0 accepts are listed in Table 8.5:
Table 8.5: Valid Character Sets with Samba 2.0 Character Set
Matching Code Page
Definition
ISO8859-1
850Western European Unix
ISO8859-2
852Eastern European Unix
ISO8859-5
866Russian Cyrillic Unix
KOI8-R
866Alternate Russian Cyrillic Unix
Normally, the
charactersetoption is disabled completely.8.3.3 coding system
The
codingsystemoption is similar to thecharactersetoption. However, its purpose is to determine how to convert a Japanese Shift JIS code page into an appropriate Unix character set. In order to use this option, theclientcodepageoption described previously must be set to page 932. The valid coding systems that Samba 2.0 accepts are listed in Table 8.6.
Table 8.6: Valid Coding System Parameters with Samba 2.0 Character Set
Definition
SJISStandard Shift JIS
JIS8Eight-bit JIS codes
J8BBEight-bit JIS codes
J8BHEight-bit JIS codes
J8@BEight-bit JIS codes
J8@JEight-bit JIS codes
J8@HEight-bit JIS codes
JIS7Seven-bit JIS codes
J7BBSeven-bit JIS codes
J7BHSeven-bit JIS codes
J7@BSeven-bit JIS codes
J7@JSeven-bit JIS codes
J7@HSeven-bit JIS codes
JUNETJUNET codes
JUBBJUNET codes
JUBHJUNET codes
JU@BJUNET codes
JU@JJUNET codes
JU@HJUNET codes
EUCEUC codes
HEXThree-byte hexidecimal code
CAPThree-byte hexidecimal code (Columbia Appletalk Program)
8.3.4 valid chars
The
validcharsoption is an older Samba feature that will add individual characters to a code page. However, this option is being phased out in favor of more modern coding systems. You can use this option as follows:valid chars = Î valid chars = 0450:0420 0x0A20:0x0A00 valid chars = A:aEach of the characters in the list specified should be separated by spaces. If there is a colon between two characters or their numerical equivalents, the data to the left of the colon is considered an uppercase character, while the data to the right is considered the lowercase character. You can represent characters both by literals (if you can type them) and by octal, hexidecimal, or decimal Unicode equivalents.
We recommend against using this option. Instead, go with one of the standard code pages listed earlier in this section. If you do use this option, however, it must be listed after the
clientcodepageto which you wish to add the character. Otherwise, the characters will not be added.
© 1999, O'Reilly & Associates, Inc.