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 |
---|---|---|---|---|
|
Described in this section |
Sets a code page to expect from clients |
850 |
Global |
|
Described in this section |
Translates code pages into alternate UNIX character sets |
None |
Global |
|
Described in this section |
Translates code page 932 into an Asian character set |
None |
Global |
|
string (set of characters) |
Obsolete: formerly added individual characters to a code page, and had to be used after setting client code page |
None |
Global |
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 client
code
page
option 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 |
---|---|
| |
|
Windows 95 Greek |
|
MS-DOS Latin 1 (Western European) |
|
MS-DOS Latin 2 (Eastern European) |
|
MS-DOS Icelandic |
|
MS-DOS Cyrillic (Russian) |
|
MS-DOS Japanese Shift-JIS |
|
MS-DOS Simplified Chinese |
|
MS-DOS Korean Hangul |
|
MS-DOS Traditional Chinese |
You can set the client code page as follows:
[global] client code page = 852
The 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.
The global character
set
option can be used to convert filenames offered through a DOS code page (see the previous section, Section 8.3.1) 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-1
Note that you must include a client
code
page
option 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:
Normally, the character
set
option is disabled completely.
The coding
system
option is similar to the character
set
option. 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, the client
code
page
option 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 |
---|---|
| |
|
Eight-bit JIS codes |
|
Eight-bit JIS codes |
|
Eight-bit JIS codes |
|
Eight-bit JIS codes |
|
Eight-bit JIS codes |
|
Eight-bit JIS codes |
|
Seven-bit JIS codes |
|
Seven-bit JIS codes |
|
Seven-bit JIS codes |
|
Seven-bit JIS codes |
|
Seven-bit JIS codes |
|
Seven-bit JIS codes |
|
JUNET codes |
|
JUNET codes |
|
JUNET codes |
|
JUNET codes |
|
JUNET codes |
|
JUNET codes |
|
EUC codes |
|
Three-byte hexidecimal code |
|
Three-byte hexidecimal code (Columbia Appletalk Program) |
The valid
chars
option 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:a
Each 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 client
code
page
to which you wish to add the character. Otherwise, the characters will not be added.
Get Using Samba now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.