Bug 448274

Summary: Error when opening an epub format ebook with Chinese file name
Product: [Applications] okular Reporter: Moss <moss-xhfeng>
Component: EPub backendAssignee: Okular developers <okular-devel>
Status: RESOLVED FIXED    
Severity: normal CC: aacid, fanng233
Priority: NOR    
Version: 20.12.1   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Moss 2022-01-11 17:41:00 UTC
SUMMARY
Error when opening epub format eBooks with Chinese file names. Change the file name to English and it will work fine.


STEPS TO REPRODUCE
1. Click the File button and select Open
2. Select a Chinese name for the epub file

OBSERVED RESULT
Pop-up error message:
Could not open file: xxx.epub. Error while opening the Epub document.

EXPECTED RESULT
The epub file is opened normally.

SOFTWARE/OS VERSIONS
Windows: 
Version Windows 11 Professional
Version 21H2

 okular (21.12.1-885)

ADDITIONAL INFORMATION
I installed the okular with scoop. The links to the software package sources: 
https://binary-factory.kde.org/view/Windows%2064-bit/job/Okular_Release_win64/885/artifact/okular-21.12.1-885-windows-msvc2019_64-cl.7z
Comment 1 Moss 2022-01-11 17:54:12 UTC
I' m sorry for the inaccurate description of the steps. I meant to choose an epub file with a Chinese name.
Comment 2 Bug Janitor Service 2022-01-21 14:09:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/548
Comment 3 Albert Astals Cid 2022-01-21 14:32:11 UTC
*** Bug 423212 has been marked as a duplicate of this bug. ***
Comment 4 Albert Astals Cid 2022-01-29 00:51:25 UTC
Git commit 5d1d412092ada95da12190ef6738140c6667cbd1 by Albert Astals Cid.
Committed on 29/01/2022 at 00:42.
Pushed by aacid into branch 'release/21.12'.

Fix opening epub files with non ascii names on Windows

epub_open wants an utf8 in Windows

It probably also wants utf8 in Linux, but the qPrintable already gives
us an utf8 in most of the normal Linux locales, so don't touch that

M  +4    -0    generators/epub/epubdocument.cpp

https://invent.kde.org/graphics/okular/commit/5d1d412092ada95da12190ef6738140c6667cbd1