TC9.0 Final: Chinese file name in zip file garbled

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
langeryang
Junior Member
Junior Member
Posts: 5
Joined: 2016-12-08, 04:05 UTC

TC9.0 Final: Chinese file name in zip file garbled

Post by *langeryang »

When I compress files into a zip file, some file names with Chinese characters '硕' and '学' are garbled.
How can I resove it?
User avatar
hlloyge
Member
Member
Posts: 131
Joined: 2006-11-02, 23:14 UTC

Post by *hlloyge »

Encode filenames in ZIP to Unicode?
Change font?
langeryang
Junior Member
Junior Member
Posts: 5
Joined: 2016-12-08, 04:05 UTC

Post by *langeryang »

hlloyge wrote:Encode filenames in ZIP to Unicode?
Change font?
If I decompress the ZIP file in the Windows Explorer, all the filenames are OK. If I decompress it in TC, some filenames containing Chinese characters are garbled while some other filenames also containing Chinese characters are OK.

If I use the option 'All as UTF-8 if at least one contains characters>127', all the filenames are OK in TC. But in the Windows Explorer, all Chinese characters are garbled and only a part of the files can be decompressed.

My operating system is Win7 x64.
yong
Member
Member
Posts: 118
Joined: 2009-05-20, 07:23 UTC

Post by *yong »

Confirmed on TC 9.0a rc2 x86 & x64, Win 7 x64.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50909
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Total Commander follows the original ZIP standard by pkzip, which uses the OEM/DOS charset for file names. I guess that the program which created your ZIP uses the Windows charset, but didn't set Windows as the creating operating system. Then the names will be wrong. Sorry, I don't plan to change that.

Explorer does not support the Unicode flag. But you can put the Unicode name in the extra field to keep compatibility with Explorer.

Btw, is this the same in TC 8.52a?

Edit: I just switched to Chinese (main land) locale and packed file 硕学.txt with ZIP in Total Commander. The file appears fine in the ZIP. Which program did you use to create the zip?
Author of Total Commander
https://www.ghisler.com
langeryang
Junior Member
Junior Member
Posts: 5
Joined: 2016-12-08, 04:05 UTC

Post by *langeryang »

There is no problem in TC 8.52a.

I created the ZIP file in TC 9.0 final with the option 'Use interal ZIP packer' checked.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50909
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I don't see a difference between TC 8.52a and TC 9.0. Could you send me two very small zip files to support at ghisler dot com, one created with TC 8.52a and one with TC 9.0?
Author of Total Commander
https://www.ghisler.com
langeryang
Junior Member
Junior Member
Posts: 5
Joined: 2016-12-08, 04:05 UTC

Post by *langeryang »

Hi, I've just sent the required files.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50909
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for the files. They are identical, so the problem isn't with creation, but with unpacking.

I found out that the following bugfix causes the problem:
12.12.16 Fixed: Disabled the fix "Support invalid ZIP archives with UTF-8-encoded names but missing UTF-8 flag (created by Dropbox)" ony systems with double byte charset like Chinese, because some valid Chinese characters would be detected as UTF-8 (32/64)

The characters you list also represent valid UTF-8 codes, so they are recognized as UTF-8 by mistake. I will turn off automatic UTF-8 detection for multi-byte languages. Too bad for Dropbox that they can't read the ZIP standard...
Author of Total Commander
https://www.ghisler.com
langeryang
Junior Member
Junior Member
Posts: 5
Joined: 2016-12-08, 04:05 UTC

Post by *langeryang »

Good news and thank you!
Post Reply