Garbled characters in compressed packages between linux and windows
Source: Internet
Author: User
The compressed package between linux and windows is garbled-Linux general technology-Linux technology and application information. The following is a detailed description. This problem happened to me for one night and I haven't found a proper method yet. It's really depressing to record what I found, as shown below:
Problem:
I used fasterCSV in rails to export something in the DB, encoded as a UTF-8, and checked everything on linux, but I used zip, gzip, tar, 7zip, rar, and biz and other compression, and then transmitted to windows, open the discovery is garbled.
Specific performance:
1. zip, tar, gzip, and biz files are compressed. Chinese file names and data files are garbled;
2. It is packaged with 7zip and rar and opened in windows. The Chinese name is normal, but the internal data files are garbled.
Swap compressed files between linux and windows platforms. If the file name contains Chinese characters, garbled characters may sometimes cause trouble in file exchanges between platforms. I have studied it carefully today and summarized some of the following experiences for you to share.
1. 7zip and rar (I use 3.50, as if the old version of rar is not available) will convert the file name encoding and use the internal file name Encoding
Unicode, the use of these two formats in the linuxlinuxand Windows platform exchange will not be messy, its format (such as tar.gz, tar.bz2) does not seem to be converted, so it is not suitable for exchanges between platforms. But in view of linux's free spirit, commercial software rar is not recommended, and free 7zip is recommended. However, I found that there are still problems in using Ubuntu (my Edge) file-roeller to process the 7zip file, but there is no problem with using the command line, therefore, we recommend that you use the 7zip command line.
According to the information found, only the file name will contain garbled characters and the body content will not contain garbled characters. It is really strange.
After my local test is compressed using 7zip or rar, the Chinese file name is normal, but the Chinese characters in the internal data file are still garbled, strange.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service