add zip support in unarchiver plugin
AbandonedPublic

Authored by elvisangelaccio on Apr 16 2016, 2:02 AM.

Details

Reviewers
acelankao
Group Reviewers
Ark
Summary

The Chinese filename in zip archive which compressed under win xp/win 7
won't unarchive correctly by 7z nor zip command.
It's an old bug[1] and still exists.
Luckily unar can fix this issue perfectly, so add zip mimetype in unarchiver
and increase its priority to handle zip archive.

  1. https://bugzilla.gnome.org/show_bug.cgi?id=306403
Test Plan
  1. "git clone kde:ark" and build the latest ark and unarchive my zip file
  2. It's totally unreadable like this

(I use "7z l" to get the result, the highest priority plugin to handle zip mimetype)
2016-03-21 10:38:56 ..... 30208 8269 ¤½¶}¾\Äý¸ê®Æ¼t°Ó·N¨£ªí.doc
2016-03-21 10:38:56 ..... 306176 73434 «´¬ù±ø´Úªþ¥ó¤@_°]ª«³W®æ®Ñ.xls
2016-03-21 10:38:56 ..... 39424 9654 «´¬ù±ø´Úªþ¥ó¤T_Å禬¬ö¿ýÀÉ.doc

  1. With the patch, it works well, including listing filenames,

open libreoffice by clicking the filename listed in ark, and
unarchive the whole zip file.
(I use "lsar" to get the result which is wriiten in unarchiver plugin")
(I'm not sure if those chinese characters could be handle well by the review tool)
公開閱覽資料廠商意見表.doc
契約條款附件一_財物規格書.xls
契約條款附件三_驗收紀錄檔.doc

Diff Detail

Repository
R36 Ark
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
acelankao updated this revision to Diff 3372.Apr 16 2016, 2:02 AM
acelankao retitled this revision from to add zip support in unarchiver plugin.
acelankao updated this object.
acelankao edited the test plan for this revision. (Show Details)
acelankao added a reviewer: Ark.
Restricted Application added a project: Ark. · View Herald TranscriptApr 16 2016, 2:02 AM
Restricted Application added a subscriber: kde-utils-devel. · View Herald Transcript

I'm sorry but this patch would make Ark unable to create zip archives, since the unarchiver plugin is read-only.

We need to find a better solution. I'm currently working on a rework of the plugin architecture, to make it more flexible and user-configurable. Once we have that, we can consider adding more mimetypes to unarchiver.

In the meantime, what's your p7zip version? Tha latest 15.14 upstream version has some improvements in filenames encoding, maybe you can try with that.

I tried the latest debian package I can find, the version is
7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31
But no luck, the file name still doesn't be handled well.

May I know your plan when you will finish the re-work?
Do you have a development git tree that I could try?
We're suffering for the unreadable file name for a very long time,
I would like to help on this to make the progress faster,
what can I do?

May I know your plan when you will finish the re-work?
Do you have a development git tree that I could try?

No, I plan to merge everything on master. The goal is to be able to enable/disable a specific plugin.
Initially it will only be possible to do so by manually editing the ~/.config/arkrc file. Hopefully a GUI in the settings dialog will be available before the 16.08 release.

We're suffering for the unreadable file name for a very long time,
I would like to help on this to make the progress faster,
what can I do?

Not much unfortunately on the Ark side. There is very little we can do for now. However you can try to report the issue to the upstream developers of 7z (p7zip): https://sourceforge.net/p/p7zip/bugs/?source=navbar

To enable/disable a specific plugin is still not a good solution to my issue.
I'm thinking of adding some code to make it fallback to the second priority
plugin to do some other action which is no provided by the first
priority plugin.

Do you agree this solution?
I think this does not conflict with your current work.

To enable/disable a specific plugin is still not a good solution to my issue.
I'm thinking of adding some code to make it fallback to the second priority
plugin to do some other action which is no provided by the first
priority plugin.

This would be good, but it's not going to be easy to implement.
You would need somehow to detect that the first ListJob failed to provide readable filenames, and then start another job with another plugin.

Do you agree this solution?
I think this does not conflict with your current work.

It doesn't :)

Hi,

I got a new idea that we can provide a plugin selection box on the toolbar,
so that user can change the plugin they use during runtime.
If this is acceptable, we can add one more selection box after plugin selection if the plugin support enconding option.
What do you think?

Hi,

I got a new idea that we can provide a plugin selection box on the toolbar,
so that user can change the plugin they use during runtime.
If this is acceptable, we can add one more selection box after plugin selection if the plugin support enconding option.
What do you think?

The toolbar is not the right place. Most kde apps show a "plugin manager" page in their settings dialog, we should do something similar.

elvisangelaccio requested changes to this revision.May 7 2016, 2:31 PM
elvisangelaccio added a reviewer: elvisangelaccio.
elvisangelaccio added inline comments.
plugins/cliunarchiverplugin/kerfuffle_cliunarchiver.json
54

Please don't change this line. On current master is now possible to enable/disable plugins (see D1477 for details), so it's not necessary anymore to change the priority.

This revision now requires changes to proceed.May 7 2016, 2:31 PM

@acelankao
You got less than one day if you want to get this patch in the upcoming Applications 16.08 release :D

elvisangelaccio commandeered this revision.Oct 9 2016, 8:38 AM
elvisangelaccio abandoned this revision.
elvisangelaccio edited reviewers, added: acelankao; removed: elvisangelaccio.

Closing for now, please reopen if you still want this to get in.