How can I change name-encoding opening a zip file?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
myungsuk
New Member
New Member
Posts: 1
Joined: 2019-05-29, 07:55 UTC

How can I change name-encoding opening a zip file?

Post by *myungsuk »

I tried to open a zip file in Total Commander.
It showed unreadable codes.
Image: http://www.myungsuk.com/font.png
I tried the winrar software and changed the name-encoding to Korean and it worked.
Image: http://www.myungsuk.com/font2.png
Is there a I can do that in Total Commander?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How can I change name-encoding opening a zip file?

Post by *ghisler(Author) »

Total Commander 9.50 will support it. The beta test will start here in the forum in a few weeks.
Author of Total Commander
https://www.ghisler.com
Andrey S
New Member
New Member
Posts: 1
Joined: 2021-07-20, 08:42 UTC

Re: How can I change name-encoding opening a zip file?

Post by *Andrey S »

> Total Commander 9.50 will support it.
I have Total Commander 10.0. How to change it?

P.S. Thank you for a very good program!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How can I change name-encoding opening a zip file?

Post by *ghisler(Author) »

When you open a ZIP with ENTER or Ctrl+PageDown, it shows [auto] in the "Name" column of the tabstop header (it must be enabled via Configuration - Options - Layout - Show tapstop header).

Right click on [auto] and choose the encoding you need.
Please note that when an archive is encoded with UTF-8 and indicates that in the header, this cannot be changed.
Author of Total Commander
https://www.ghisler.com
User avatar
yyang
Member
Member
Posts: 155
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: How can I change name-encoding opening a zip file?

Post by *yyang »

ghisler(Author) wrote: 2021-07-20, 08:59 UTC When you open a ZIP with ENTER or Ctrl+PageDown, it shows [auto] in the "Name" column of the tabstop header.
Is it possible to add a configuration for the preferred default encoding, or inherit the last used one? It seems the "auto" method often fails to detect UTF-8 encoding names in zip files generated on macOS (judging from the "__MACOSX" folder, not sure about the program used).

Blame on these non-standard-compliant zip files, but it'll make one's life easier to try out UTF-8 "everywhere".
#147523
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How can I change name-encoding opening a zip file?

Post by *ghisler(Author) »

The ZIP standard uses a specific bit in the header flags to mark headers using UTF-8. Currently I'm not trying to auto-detect UTF-8 when this flag isn't set, because it can lead to false positives with some Asian languages.
Author of Total Commander
https://www.ghisler.com
User avatar
yyang
Member
Member
Posts: 155
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: How can I change name-encoding opening a zip file?

Post by *yyang »

Thanks for the reply! As a user from China, my daily experience is, without the UTF-8 bit, 7-zip and WinRAR "always" write the correct file names, and Total Commander needs some manual help. When a coworker sends me some zip file, I hate to interrupt the workflow inside Total Commander and remind myself, "oh, it's a 7-zip job". Having an option to default to UTF-8 despite the false positives (highly unlikely in my environment) would be dreamy...
#147523
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How can I change name-encoding opening a zip file?

Post by *ghisler(Author) »

Since they seem to use 7zip and WinRAR, why not ask them to send you 7z/rar files? There are no such encoding problems with these two formats.
Author of Total Commander
https://www.ghisler.com
User avatar
yyang
Member
Member
Posts: 155
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: How can I change name-encoding opening a zip file?

Post by *yyang »

I don't think these .zip files are generated by 7-zip or WinRAR. I meant both 7-zip and WinRAR could handle this encoding issue automatically in decompression, and it's a pity Total Commander could not. Sorry for not making my point clear.
#147523
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How can I change name-encoding opening a zip file?

Post by *ghisler(Author) »

I need to see a test file before I can decide whether there is something I can do or not.
Maybe you can edit some files and just remove the contents or replace them with xxx and pack them back.
Author of Total Commander
https://www.ghisler.com
User avatar
yyang
Member
Member
Posts: 155
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: How can I change name-encoding opening a zip file?

Post by *yyang »

I've emailed you a sample zip file. Thanks a lot!
#147523
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How can I change name-encoding opening a zip file?

Post by *ghisler(Author) »

Got it, thanks! The problem is that both in ANSI and UTF-8 encoding the file name contains valid Chinese characters. The flags indicate that the file doesn't use UTF-8...
Author of Total Commander
https://www.ghisler.com
User avatar
yyang
Member
Member
Posts: 155
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: How can I change name-encoding opening a zip file?

Post by *yyang »

Thanks for the investigation! I still wonder why standalone file archivers like 7-Zip and WinRAR could guess so well... Is there space for improvement? My personal wish is an option or something to "always try UTF-8 first" (at any risk).
#147523
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How can I change name-encoding opening a zip file?

Post by *ghisler(Author) »

They probably can't, they just do the check for valid UTF-8 and ignore that the text could also be valid ANSI as the header indicates...

One solution would be an option in the wincmd.ini, e.g. PreferUtf8Dection or so...
Author of Total Commander
https://www.ghisler.com
User avatar
yyang
Member
Member
Posts: 155
Joined: 2007-03-27, 11:41 UTC
Location: China

Re: How can I change name-encoding opening a zip file?

Post by *yyang »

Such an option would be good enough. Thanks in advance.
#147523
Post Reply