[solved] Problem with specific UTF-8 chars sequence in name inside ZIP archive.

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
TomasT342
Junior Member
Junior Member
Posts: 3
Joined: 2023-08-14, 17:06 UTC

[solved] Problem with specific UTF-8 chars sequence in name inside ZIP archive.

Post by *TomasT342 »

When I try rename the file inside the ZIP archive to "pošťák.txt" (postman in Czech language), the name is changed to "po眠k.txt" while saving.
The names "pošťak.txt" and "posťák.txt" are saved without any problems.
Name "Ž pošťák.txt" is saved OK, name "Z pošťák.txt" is saved as "Z po眠k.txt"
The already existing name "pošťák.txt" inside the ZIP archive is displayed without problems.
Configuration for Zip: "Internal Zip packer", "Store Unicode names as UTF-8" (the change does not affect the problem)

In the previous version of TC (10.x) on the same computer, the name "pošťák.txt" is saved without any problems.
(Windows 10 22H2 build 19045.3324, TC 11.00)
User avatar
petermad
Power Member
Power Member
Posts: 16030
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Problem with specific UTF-8 chars sequence in name inside ZIP archive.

Post by *petermad »

I cannot reproduce this, when copy-pasting the names from your report to the new name inside the archive.

When I try rename the file inside the ZIP archive to "pošťák.txt"
The already existing name "pošťák.txt" inside the ZIP archive is displayed without problems.
These two lines seems to contradict each other - how can you rename a file to a name that is already present inside the archive?
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Gral
Power Member
Power Member
Posts: 1600
Joined: 2005-01-26, 15:12 UTC

Re: Problem with specific UTF-8 chars sequence in name inside ZIP archive.

Post by *Gral »

I can cofirm this with Polish locale so the same codepage is used. Interesing that this invalid name is correct in DOS codepage - 852


petermad wrote: 2023-08-14, 18:11 UTC
TomasT342 wrote: 2023-08-14, 17:39 UTCThe already existing name "pošťák.txt" inside the ZIP archive is displayed without problems.
These two lines seems to contradict each other - how can you rename a file to a name that is already present inside the archive?
Probably because this is another copy, and:
TomasT342 wrote: 2023-08-14, 17:39 UTCIn the previous version of TC (10.x) on the same computer, the name "pošťák.txt" is saved without any problems.
User avatar
petermad
Power Member
Power Member
Posts: 16030
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Problem with specific UTF-8 chars sequence in name inside ZIP archive.

Post by *petermad »

Hmm, all I know that this zip-file: https://tcmd.madsenworld.dk/postmantest.zip is packed whith TC 11.00, and all the filenames looks like what I see in the first post of this topic.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
TomasT342
Junior Member
Junior Member
Posts: 3
Joined: 2023-08-14, 17:06 UTC

Re: Problem with specific UTF-8 chars sequence in name inside ZIP archive.

Post by *TomasT342 »

I tried different renames again today and the problem is really strange.
It really isn't easily reproducible.

I named one particular file in the ZIP archive "Pošťák", when saved it changed to "Po眠k" (that's a mistake).
I changed its name again and just added a space at the end, the file was saved as "Po_k " (that's a mistake).
I changed its name again, removed the space, the file was saved as "Po_k" (it's fine now).
Now I have renamed it again to "Pošťák" and the name has been saved correctly.

Another interesting finding - if I open the archive in WinRAR, the file name appears to be fine. The file that I see in TC11 as "Po眠k" I see in WinRAR as "Pošťák".

There is some problem there at the beginning, but it manifests itself randomly and can probably be removed by repeated renaming.
I am adding a link to the ZIP archive in which the problem occurred:
https://anonymfile.com/2oOxA/brin-d-pok.zip
User avatar
jbcb
Junior Member
Junior Member
Posts: 38
Joined: 2013-08-30, 06:43 UTC

Re: Problem with specific UTF-8 chars sequence in name inside ZIP archive.

Post by *jbcb »

Confirmed.

postman.png
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50479
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Problem with specific UTF-8 chars sequence in name inside ZIP archive.

Post by *ghisler(Author) »

This happens because the character sequence is valid UTF-8, and some packers don't set the UTF-8 flag when packing.
Please add the line
PreferUtf8ForZip=0
to your wincmd.ini, section [Packer].

Here is a thread with a similar problem:
viewtopic.php?p=429308#p429308

Unfortunately there is no solution, the name is valid both in local encoding and UTF-8.
Author of Total Commander
https://www.ghisler.com
TomasT342
Junior Member
Junior Member
Posts: 3
Joined: 2023-08-14, 17:06 UTC

Re: Problem with specific UTF-8 chars sequence in name inside ZIP archive.

Post by *TomasT342 »

Thanks, this solution is suitable for me.
User avatar
petermad
Power Member
Power Member
Posts: 16030
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Problem with specific UTF-8 chars sequence in name inside ZIP archive.

Post by *petermad »

Moderator message from: petermad » 2023-08-15, 22:47 UTC

Moved to "Total commander (English)" from "TC11.x bug reports (English)"
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply