Bug 89051 - Kzip: Want Kzip to convert filename charsets in archives & patch
Summary: Kzip: Want Kzip to convert filename charsets in archives & patch
Status: RESOLVED WORKSFORME
Alias: None
Product: frameworks-karchive
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.20.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-08 07:00 UTC by OGINO Tomonori
Modified: 2022-11-18 05:16 UTC (History)
3 users (show)

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


Attachments
kzip_dosfilename_jp.patch (1.60 KB, patch)
2004-09-08 07:09 UTC, OGINO Tomonori
Details
a small zip file with SJIS(Japanese-DOS) encoding. (275 bytes, application/x-zip)
2004-09-29 15:22 UTC, OGINO Tomonori
Details
ZIP attachment imported from bug #335716 (390 bytes, application/zip)
2016-03-07 11:09 UTC, Alexander Potashev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OGINO Tomonori 2004-09-08 07:00:05 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

In Japan, a zip made by msdos/ms-windows has filenames in Shift-JIS encoding, is different with the UNIX filename encoding,"EUC-JP".

I with to KZip coverts the file name encoding in this case.

Fortunately zip file format keeps make-by-os infomation. With this info, we can safely choose qt-text-codec for convertion, I supposed.
Comment 1 OGINO Tomonori 2004-09-08 07:09:11 UTC
Created attachment 7448 [details]
kzip_dosfilename_jp.patch

if in JAPANESE_LOCALE, 
Converts a file name encodings to UNICODE in the zip archive made by
msdos/ms-windows 
    from "Shift-JIS", 
not from Unix filesystem encoding provided by QFile::decodeName().
Comment 2 Holger Schröder 2004-09-17 20:09:27 UTC
Hi,

could you please attach a small zip file with this encoding, so that i can test it before applying the patch ?

thanks, Holger 
Comment 3 OGINO Tomonori 2004-09-29 15:22:26 UTC
Created attachment 7724 [details]
a small zip file with SJIS(Japanese-DOS) encoding.

This ZIP file is created by Info-ZIP on MS-Windows(Japanese)
H:\tmp\k>unzip -l a.zip
Archive:  a.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
       36  04-09-29 22:14   あいうえお.txt
 --------		    -------
       36		    1 file
Comment 4 Nicolas Goutte 2005-08-06 20:20:33 UTC
See also bug #82436 for problem about ZIP file name encoding.
Comment 5 Alexander Potashev 2016-03-07 11:09:29 UTC
Created attachment 97738 [details]
ZIP attachment imported from bug #335716

Same problem with ZIP archives created by Windows containing filenames in Russian. In these ZIP files filename encoding is CP866 (the one used for Russian in MS-DOS), but QFile::decodeName() uses encoding from locale which is most often UTF-8.

The code in karchive/src/kzip.cpp from KF 5.20.0 is still affected.
Comment 6 Alexander Potashev 2016-03-07 11:11:18 UTC
It's a bug because some archives cannot be opened correctly.
Comment 7 David Faure 2016-03-26 11:58:30 UTC
The big question is whether the information of the filename encoding is present in the ZIP file format.
Comment 8 OGINO Tomonori 2016-03-26 15:59:03 UTC
No.  Formerly, The information of the filename encoding is NOT present in the ZIP file format.

The information of the OS that the zip file made by is present in the "version made by" ZIP file header.The filename encoding , in most case, is determined with "version made by" and User Language by a historical reasons. 

See also
https://marcosc.com/2008/12/zip-files-and-encoding-i-hate-you/ 


But nowadays,  UTF-8 international file name storage was introduced in APPNOTE.TXT version  6.3.0, 2006-09-29. 
http://www.digitalpreservation.gov/formats/fdd/fdd000354.shtml
What can we do?
Comment 9 Justin Zobel 2022-10-19 22:10:43 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 10 Bug Janitor Service 2022-11-03 05:06:14 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 Bug Janitor Service 2022-11-18 05:16:30 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!