Bug 335716 - Incorrect displaying file names in .zip cp2151
Summary: Incorrect displaying file names in .zip cp2151
Status: RESOLVED UPSTREAM
Alias: None
Product: ark
Classification: Applications
Component: plugins (other bugs)
Version First Reported In: 2.19
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: Ragnar Thomsen
URL: https://www.dropbox.com/s/e4wwsaqkprr...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-02 20:28 UTC by shov
Modified: 2016-03-30 12:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
zip (390 bytes, application/zip)
2014-08-18 11:56 UTC, shov
Details
rar (136 bytes, application/x-rar-compressed)
2014-08-18 11:56 UTC, shov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shov 2014-06-02 20:28:28 UTC
When i open .zip packed by windows, i see incorrect displaying russian file names.
I know why (it because it in cp2151), but can't change encoding for read.

Reproducible: Always

Steps to Reproduce:
1. Add menu for manually choose encoding
2.
3.
Comment 1 Alexander Potashev 2014-08-16 22:00:28 UTC
Please create a sample ZIP archive and attach it here so anyone can try to reproduce the bug. I couldn't reproduce it with the .zip files I've got here: they must have been created under Win7, but I can't do the same on my own since I don't have a Windows PC around here.

Related/duplicate bugs:
 - https://bugs.kde.org/show_bug.cgi?id=187201
 - https://bugs.kde.org/show_bug.cgi?id=188576
Comment 2 shov 2014-08-18 11:56:03 UTC
Created attachment 88297 [details]
zip

Zip file packet by WinRar on win64 (win 8). Used russian file names.
Comment 3 shov 2014-08-18 11:56:21 UTC
Created attachment 88298 [details]
rar

Zip file packet by WinRar on win64 (win 8). Used russian file names.
Comment 4 shov 2014-08-18 11:56:40 UTC
Comment on attachment 88298 [details]
rar

Rar file packet by WinRar on win64 (win 8). Used russian file names.
Comment 5 Alexander Potashev 2015-03-29 06:30:11 UTC
Both of your attachments (ZIP and RAR) are open correctly in Ark here (KF5-based, installed from Git on 23.03.2015).

What locale do you have? Please post your output of "locale". I have "ru_RU.utf8".
Comment 6 Elvis Angelaccio 2016-01-14 16:00:16 UTC
Still waiting for the info requested by Alexander. Marking as NEEDSINFO for now.
Comment 7 Alexander Potashev 2016-03-07 10:38:15 UTC
I was able to reproduce the problem with the attached ZIP file. For me it uses the kerfuffle_cli7z plugin and thus runs "7z". 7z is responsible for extracting wrong filenames (note the "Path:" lines below):

=====
aspotashev@cell ~ $ /usr/bin/7z  l -slt /home/aspotashev/kde-git/karchive/autotests/data/russianFilenames.zip

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
p7zip Version 9.20 (locale=ru_RU.UTF-8,Utf16=on,HugeFiles=on,2 CPUs)

Listing archive: /home/aspotashev/kde-git/karchive/autotests/data/russianFilenames.zip

--
Path = /home/aspotashev/kde-git/karchive/autotests/data/russianFilenames.zip
Type = zip
Physical Size = 390

----------
Path = ¯ ¯ª 
Folder = +
Size = 0
Packed Size = 0
Modified = 2014-08-18 15:52:37
Created = 2014-08-18 15:52:23
Accessed = 2014-08-18 15:52:37
Attributes = D....
Encrypted = -
Comment = 
CRC = 
Method = Store
Host OS = FAT
Version = 10

Path = ¯ ¯ª /ä ©«.txt
Folder = -
Size = 0
Packed Size = 0
Modified = 2014-08-18 15:52:34                                                                                                                                              
Created = 2014-08-18 15:52:34                                                                                                                                               
Accessed = 2014-08-18 15:52:34                                                                                                                                              
Attributes = ....A                                                                                                                                                          
Encrypted = -
Comment = 
CRC = 00000000
Method = Store
Host OS = FAT
Version = 10
Comment 8 Alexander Potashev 2016-03-07 10:43:34 UTC
The attached RAR file opens here correctly in Ark using "kerfuffle_clirar".

Alex, can you please share the command line output from Ark after opening the archive files causing problems?
Comment 9 Elvis Angelaccio 2016-03-07 10:44:20 UTC
Hi Alexander, thanks for the update!
Does it mean that your locale (still ru_RU.utf8?) does not make any difference on the output of 7z?
Comment 10 Alexander Potashev 2016-03-07 10:52:31 UTC
That's right. I have the ru_RU.UTF-8 locale and 7z has the above problem.

As for ZIP, this bug can be resolved as upstream. Btw, if I temporarily move the 7z* executables, Ark falls back to kerfuffle_clizip and the file list is displayed correctly. kerfuffle_clizip should probably have higher priority than kerfuffle_cli7z.

I would still wait for the details about RAR because I can't reproduce the problem with RAR.
Comment 11 Elvis Angelaccio 2016-03-07 11:02:52 UTC
(In reply to Alexander Potashev from comment #10)
> Btw, if I temporarily move
> the 7z* executables, Ark falls back to kerfuffle_clizip and the file list is
> displayed correctly. kerfuffle_clizip should probably have higher priority
> than kerfuffle_cli7z.

The problem is that kerfuffle_clizip's unzip has serious issues with other locales (e.g. with turkish characters IIRC) and it may create files which cannot even be deleted by Dolphin.
That's why we gave higher priority to kerfuffle_cli7z, since Ark 15.12.

Anyway I'm marking this bug as confirmed. But sadly I don't see an easy solution :(
Comment 12 Ragnar Thomsen 2016-03-07 11:44:03 UTC
Alexander, I can see you run version 9.20 of p7zip. This is a rather old version from 2010. Can you try updating to 15.09 to see if it handles the russian filenames better?
Comment 13 Alexander Potashev 2016-03-07 12:38:56 UTC
Same problem when opening ZIP with 7z 15.09 beta:

=====
aspotashev@cell ~ $ /usr/bin/7z l -slt /home/aspotashev/Downloads/cyrilic_bug.zip

7-Zip [64] 15.09 beta : Copyright (c) 1999-2015 Igor Pavlov : 2015-10-16
p7zip Version 15.09 beta (locale=ru_RU.UTF-8,Utf16=on,HugeFiles=on,64 bits,2 CPUs Intel(R) Celeron(R) CPU B800 @ 1.50GHz (206A7),ASM)

Scanning the drive for archives:
1 file, 390 bytes (1 KiB)            

Listing archive: /home/aspotashev/Downloads/cyrilic_bug.zip

--
Path = /home/aspotashev/Downloads/cyrilic_bug.zip
Type = zip
Physical Size = 390

----------
Path = ¯ ¯ª 
Folder = +
Size = 0
Packed Size = 0
Modified = 2014-08-18 14:52:37
Created = 2014-08-18 14:52:23
Accessed = 2014-08-18 14:52:37
Attributes = D
Encrypted = -
Comment = 
CRC = 
Method = Store
Host OS = FAT
Version = 10

Path = ¯ ¯ª /ä ©«.txt
Folder = -
Size = 0
Packed Size = 0
Modified = 2014-08-18 14:52:34
Created = 2014-08-18 14:52:34
Accessed = 2014-08-18 14:52:34
Attributes = A
Encrypted = -                                                                                                                                                               
Comment =                                                                                                                                                                   
CRC = 00000000                                                                                                                                                              
Method = Store                                                                                                                                                              
Host OS = FAT
Version = 10
Comment 14 Alexander Potashev 2016-03-07 12:51:11 UTC
I would also expect the 7z's "-mcp=866" option to decode from the CP866 encoding, but this option does not change the output, i don't know why.
Comment 15 Ragnar Thomsen 2016-03-08 20:43:32 UTC
Infozip 6.00 can't display the filnames correctly either.

Output of "zipinfo -l -T -z cyrilic_bug.zip":
Archive:  cyrilic_bug.zip
Zip file size: 390 bytes, number of entries: 2
drwx---     3.1 fat        0 bx        0 stor 20140818.145236 ?????/
-rw-a--     3.1 fat        0 bx        0 stor 20140818.145234 ?????/????.txt
2 files, 0 bytes uncompressed, 0 bytes compressed:  0.0%

Alexander, what version of unzip are you using? I'm guessing the 6.10b beta?
Comment 16 Alexander Potashev 2016-03-08 21:37:26 UTC
I have zip-3.0 and unzip-6.0 from http://www.info-zip.org/

> ZipInfo 3.00 of 20 April 2009, by Greg Roelofs and the Info-ZIP group.

And it works correctly:

aspotashev@cell ~ $ zipinfo -l -T -z Downloads/cyrilic_bug.zip 
Archive:  Downloads/cyrilic_bug.zip
Zip file size: 390 bytes, number of entries: 2
drwx---     3.1 fat        0 bx        0 stor 20140818.145236 папка/
-rw-a--     3.1 fat        0 bx        0 stor 20140818.145234 папка/файл.txt
2 files, 0 bytes uncompressed, 0 bytes compressed:  0.0%


May be it depends on the locale. I have ru_RU.UTF-8.
Comment 17 Ragnar Thomsen 2016-03-22 09:10:47 UTC
I tried with the recently released p7zip 15.14 and it fixes this bug for me (without setting Russian locale). Can you confirm, Alexander?
Comment 18 Alexander Potashev 2016-03-26 12:24:34 UTC
Fixed in p7zip 15.14. Thanks for the notification!

=====
aspotashev@cell ~ $ /usr/bin/7z l -slt /home/aspotashev/Downloads/cyrilic_bug.zip

7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
p7zip Version 15.14 (locale=ru_RU.UTF-8,Utf16=on,HugeFiles=on,64 bits,2 CPUs Intel(R) Celeron(R) CPU B800 @ 1.50GHz (206A7),ASM)

Scanning the drive for archives:
1 file, 390 bytes (1 KiB)            

Listing archive: /home/aspotashev/Downloads/cyrilic_bug.zip

--
Path = /home/aspotashev/Downloads/cyrilic_bug.zip
Type = zip
Physical Size = 390

----------
Path = папка
Folder = +
Size = 0
Packed Size = 0
Modified = 2014-08-18 14:52:37
Created = 2014-08-18 14:52:23
Accessed = 2014-08-18 14:52:37
Attributes = D
Encrypted = -
Comment = 
CRC = 
Method = Store
Host OS = FAT
Version = 10

Path = папка/файл.txt
Folder = -
Size = 0
Packed Size = 0
Modified = 2014-08-18 14:52:34
Created = 2014-08-18 14:52:34
Accessed = 2014-08-18 14:52:34
Attributes = A
Encrypted = -
Comment = 
CRC = 00000000
Method = Store
Host OS = FAT
Version = 10

aspotashev@cell ~ $ /usr/bin/7z l -slt /home/aspotashev/Downloads/cyrilic_bug.rar

7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
p7zip Version 15.14 (locale=ru_RU.UTF-8,Utf16=on,HugeFiles=on,64 bits,2 CPUs Intel(R) Celeron(R) CPU B800 @ 1.50GHz (206A7),ASM)

Scanning the drive for archives:
1 file, 136 bytes (1 KiB)            

Listing archive: /home/aspotashev/Downloads/cyrilic_bug.rar

--
Path = /home/aspotashev/Downloads/cyrilic_bug.rar
Type = Rar
Physical Size = 136
Solid = -
Blocks = 2
Multivolume = -
Volumes = 1

----------
Path = папка/файл.txt
Folder = -
Size = 0
Packed Size = 0
Modified = 2014-08-18 14:52:34
Created = 
Accessed = 
Attributes = A
Encrypted = -
Solid = -
Commented = -
Split Before = -
Split After = -
CRC = 00000000
Host OS = Win32
Method = m0:17
Version = 29

Path = папка
Folder = +
Size = 0
Packed Size = 0
Modified = 2014-08-18 14:52:37
Created = 
Accessed = 
Attributes = D
Encrypted = -
Solid = -
Commented = -
Split Before = -
Split After = -
CRC = 00000000
Host OS = Win32
Method = m0
Version = 20
Comment 19 Ragnar Thomsen 2016-03-30 12:29:54 UTC
Thanks for confirming. I will resolve this as upstream.