In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to solve the problem of decompressing garbled zip files under linux. It is very detailed and has a certain reference value. Interested friends must finish reading it!
Reason
Because the zip format does not specify the encoding format, the encoding in the zip files generated under Windows is GBK/GB2312 and so on, which leads to garbled problems when these zip files are decompressed under Linux, because the default encoding under Linux is UTF8.
Solution one
Use 7z to decompress.
Install p7zip and convmv
# fedora$ su-c 'yum install p7zip convmv'# ubuntu$ sudo apt-get install p7zip convmv
Execute the command to unzip
# decompress $LANG=C 7za x your-zip-file.zip# recursive transcode $convmv-f GBK-t utf8-- notest-r using 7z.
Solution two
Files compressed on windows are compressed in Chinese by default. Because its encoding is not declared in the zip file, the unzip on linux is generally decompressed with the default encoding, and the Chinese file name will be garbled.
Although some people reported this as bug in 2005, info-zip 's official website did not include automatic identification codes in the plan, and they may not think this is a problem. Sun adopts the same way to deal with the N-year zip coding problem in java.
There are two ways to solve the problem:
1. Extract and specify the character set through the unzip line command
Unzip-O CP936 xxx.zip (GBK, GB18030 is also possible)
Interestingly, there is no description of this option in unzip's manual, and unzip-help has a simple description of this parameter.
two。 In the environment variable, specify the unzip parameter, always display and extract the file in the specified character set
Add 2 lines to / etc/environment
UNZIP= "- O CP936" ZIPINFO= "- O CP936"
In this way, the Archive Manager (file-roller) of the Gnome desktop can normally use unzip to extract Chinese, but file-roller itself cannot set the encoding to be passed to unzip.
The above is all the contents of this article entitled "how to solve the problem of decompressing garbled zip files under linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.