Bug 448274 - Error when opening an epub format ebook with Chinese file name
Summary: Error when opening an epub format ebook with Chinese file name
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: EPub backend (show other bugs)
Version: 20.12.1
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
: 423212 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-01-11 17:41 UTC by Moss
Modified: 2022-01-29 00:51 UTC (History)
2 users (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 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