unzip seems failing to correctly handle chinese character
i have some files that have Chinese file names and i'am using Redhat9 ,and the
system's enviroment is Simplified Chinese .These Chinese-name-files are compressed using rar under windows into zips ,and transfered to my linux .when i unzip them ,the Chinese-filename becomes unreadable .
so where does the problem lie ??
i guess the unzip fail to do a fine job .
I take it you are manually transferring large files between two machines.
This can be tricky - it could just be that windows is using a different way of encoding the chinese characters - have you tried writing a document with chinese characters, rar-zipping that then transferring and unzipping?
Another thing you could try, is to use pkzip instead of rar to make the zip file.
rar could just be garbling the chinese encoding in the file-names so bzip or gzip (whichever you used) has trouble reading them. Of course, just giving the file an english name and re-writing in chinese characters will also work - if a bit tedious.
A nice test would be to gzip a file in linux which had chinese character filename and then see if it unzipps with chinese under linux (and windows too - i.e. do the transfer the other way before you blame the linux unzipper.)
I'm inclined to think that the handle which tells the unzipper that the filenames should be chinese is just stripped in rar ... because of the way filenames are handled. Especially if the linux environment allows a mixture of chinese and roman character filenames.
OTOH: I've not heard of this before... and I have had no reason to use the simplified chinese environment or chinese characters in filenames. :(
thanks for your response .
I'am sure the rar can unrar the file correctly under Windows .so the Chinese file name is not corrupted. The different encoding maybe the cause of the problem .
I'm a Chinese ,large number of files i encounter daily have Chinese names .I often download zip files from Internet and unzip them under Linux only to get files with unreadable Chinese file names . Do i have to find a Windows System just to unzip a file every time?? so i decided to figure it out .
Well OK - this is why I suggested a string of experiments ...
I still think you should try compressing a file with PK-ZIP under windows and transfer to linux to see what happens. Another trick is to try compressing a file under linux with bzip (alone - do not tar) and transferring to windows to see if the chinese filenames unzip OK. Also check you can unzip that file with bzip OK (this last one will tell you if the problem lies with bzip).
In linux, you have a native chinese system (yes/no?) so I'm not familiar with this system - having only worked with chinese language in a native english system.
1. update bzip anyway - make sure you have the latest version.
2. go through your character settings to make sure everything is encoding properly
3. try something obvious - sometimes you can highlight a string that is supposed to be chinese and change the coding so it displayes chinese characters.
4. you have simplified chinese - you could change to traditional
5. download and install the microsoft chinese character fonts ...
|All times are GMT -5. The time now is 03:17 AM.|