Bug 195288 - Okular doesn't open document archives with cyrillic filenames
Summary: Okular doesn't open document archives with cyrillic filenames
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-05 02:40 UTC by wyldrodney
Modified: 2009-12-23 17:18 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wyldrodney 2009-06-05 02:40:34 UTC
Version:           0.8.80 (using 4.2.88 (KDE 4.2.88 (KDE 4.3 >= 20090527)), Gentoo)
Compiler:          x86_64-pc-linux-gnu-gcc
OS:                Linux (x86_64) release 2.6.29-zen1

1) Open any djvu document.
2) Export to "document archive" with cyrillic  filename(Архитектура.okular, for example)
3) Try to open Архитектура.okular. It shows "Невозможно открыть файл(Can't open file) file:///home/wyldrodney/Архитектура.okular".
4) Export source djvu with latin filename (Arch.okular, for example). It works.

* Renaming doesn't makes it work.
* That isn't correct zip archive, I mean:

wyldrodney@desktop ~ $ file Архитектура.okular 
Архитектура.okular: Zip archive data, at least v2.0 to extract
wyldrodney@desktop ~ $ unzip Архитектура.okular               
Archive:  Архитектура.okular                                  
error:  expected central file header signature not found (file #3).
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)   
  inflating: content.xml                                               
Архитект:  mismatching "local" filename (Архитектура.djvu),            
         continuing with "central" filename version                    
  inflating: Архитект                                                  
wyldrodney@desktop ~ $ cp Архитектура.okular Arch.okular               
wyldrodney@desktop ~ $ file Arch.okular                                
Arch.okular: Zip archive data, at least v2.0 to extract
wyldrodney@desktop ~ $ unzip Arch.okular
Archive:  Arch.okular
error:  expected central file header signature not found (file #3).
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)
replace content.xml? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: content.xml
Архитект:  mismatching "local" filename (Архитектура.djvu),
         continuing with "central" filename version
  inflating: Архитект
wyldrodney@desktop ~ $

I'll send debuginfo later.

P.S. I'm using ru_RU.UTF-8 locale.

P.P.S. Same problem on OpenSUSE 11.1
Comment 1 Pino Toscano 2009-06-06 23:08:11 UTC
Hm, it looks to me the problem is not actually in the file name of the okular archive, but in the file name of the document you are archiving, ie a djvu file having a file name with russian characters. Can you observe the same behaviour?
It would appear a bug in a kdelibs class for reading/writing ZIP files (what an okular document archive is, basically), and I've asked to its maintainer.
Comment 2 wyldrodney 2009-06-07 06:06:10 UTC
>djvu file having a file name with russian characters

Yes. This causes problems. Exporting from same file with latin name works perfectly.
Comment 3 Pino Toscano 2009-06-07 11:14:56 UTC
(In reply to comment #2)
> >djvu file having a file name with russian characters
> 
> Yes. This causes problems. Exporting from same file with latin name works
> perfectly.

Excellent, thanks :) was pin-pointing the issue, as it seemed the other way round from the initial description.
Comment 4 Pino Toscano 2009-06-08 12:30:08 UTC
SVN commit 978827 by pino:

Do not confuse the length of file names encoded as UTF-8 and with the local 8bit encoding.
BUG: 195288
Add unit test case for testing non-latin1 file names cases.


 M  +4 -3      kio/kzip.cpp  
 M  +32 -0     tests/karchivetest.cpp  
 M  +1 -0      tests/karchivetest.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=978827
Comment 5 Thomas McGuire 2009-12-23 17:18:28 UTC
SVN commit 1065547 by tmcguire:

Crossport r978827 by pino from kdelibs trunk to kdelibs e4:

Do not confuse the length of file names encoded as UTF-8 and with the local 8bit encoding.
CCBUG: 195288
Add unit test case for testing non-latin1 file names cases.



 M  +4 -3      kzip.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1065547