Enable Netatalk to support dual-byte and multi-byte character sets
Source: Internet
Author: User
Article Title: Enable Netatalk to support dual-byte and multi-byte character sets. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
I. Problems By installing samba and netatalk, you can share a PC with an apple over Linux. However, when the apple machine uploads a Chinese file name to Linux, but Linux and windows cannot see the Chinese file name, the PC saves the Chinese file name in the shared path, and the Apple machine can see the file but cannot copy the file. The error is returned: the file cannot be found. An example of the list is as follows:
File Name operation in PC (Linux): copying files from an Apple Computer (Mac OS)
Abc release Abc
Abc release Abc
: 0B: 0B thin (HEX 0x0B0x0B)
Thin (HEX 0x0B0x0B) thin can see the file name, but cannot find the file
Ii. Problem Analysis As shown in the preceding table,
When all characters in the file name are in the American Standard ASC Code (the code value is less than or equal to 0x7F), it can be displayed normally.
If the characters in the file name are not in the American Standard ASC Code (the code value is greater than 0x7F and less than 0xFF), the file cannot be displayed normally.
Is Netatalk a solution?
View its configuration file/etc/atalk/AppleVolumes. default
Fortunately, I saw it have a codepage parameter in the following format:
Codepage = the file name is under the nls path
I think this can solve the problem. I started the experiment immediately.
First codepage = 936
Second codepage = cp936
Note: cp936 is the code page of The GB2312-1980
Nls is the nls (National Language Sopport) subsystem. It is an ASC-based mechanism for providing international localization. You only need to use the correct character ing table to correctly process the local language encoding.
What are the results? All failed.
Conclusion: Netatalk has another nls mechanism to solve the localization problem.
Iii. Problem Solving 1. Objectives
File Name operation under PC [Linux] (copying files from Apple) file name under Apple [max OS]
Thin (HEX 0x0B0x0B) thin, thin (HEX 0x0B0x0B)
2. Find the path nls
Find the path/usr/lib/atalk/nls.
There are three files maccode.437, maccode.850, maccode. iso8550-1
I can't try using these codepages. Chinese is worse on the Apple Server than it used to be. Of course, the ing is incorrect!
3. Search for the Internet and there is no maccode that supports Chinese characters.
4. Only one task can be done by yourself.
5. The maccode.437, maccode.850, iso8550-1 found the law with the binary viewer. Because it is very simple, you do not need to elaborate. If you are interested, you can check it yourself.
6. I will first use GB2312 encoding for the experiment. Everyone is familiar with it. Its Encoding range is 0xA1 ---- 0xFE, which is a simple idea. It is to keep the Chinese-encoded ASC code unchanged after transmission.
7. The experiment is successful.
8. extension. I checked the encoding range of the Asian text set (dubyte encoding or multi-byte encoding. We think that extending the ing to 0x80 ---- 0xFE should support all the plain text.
Maximum Minimum value of the standard encoding range
GB2312-1989 first byte: 0xA1 ---- 0xF7 0xA1 0xFE
Second byte: 0xA1 ---- 0xFE
First GBK byte: 0x81 ---- 0xFE 0x40 0xFE
Second byte: 0x40 ---- 0x7E
0x80 ----- 0xFE
BIG-5 first byte: 0x81-0xFE 0x40 0xFE
Second byte: 0x40-0x7E
0x81 ---- 0xFE
Shift-JIS first byte: 0x81-0x9F
0xE0-0xFC 0x40 0xFC
Second byte: 0x40-0xfc (less 0x7F)
KSC-5601-1987 first byte: 0x81-0xFE 0x41 0xFE
Second byte: 0x41-0x5A,
0x61-0x7A,
0x81-0xFE
If the ASC code is less than 0x7F, it can be converted normally, so we can ignore it and only consider the ASC code greater than 0x80. The ing range is 0x80 ---- 0xFE.
4. How to Use maccode. Asia 1. Find the nls path. For example, my machine is/usr/lib/atalk/nls.
2. Copy maccode. Asia
3. Find and modify the configuration file AppleVolumes. default of appletalk. For example, my machine is/etc/atalk/AppleVolumes. default.
For example,/mnt/appletalk is the path you share with the Apple Server.
You wrote/mnt/appletalk
Add/mnt/appletalk codepage = maccode. Asia to the disk.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.