Bug 440641 - Okular Windows filename encoding issue
Summary: Okular Windows filename encoding issue
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 21.04.3
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-05 18:25 UTC by Gerald Combs
Modified: 2021-08-05 18:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Combs 2021-08-05 18:25:32 UTC
SUMMARY


STEPS TO REPRODUCE
1. Log into a Windows machine with the code page set to 437.
2. Download "Wireshark User’s Guide.epub" from https://www.wireshark.org/download/docs/.
3. Try to open the file in Okular.

OBSERVED RESULT

Okular displays the error "Could not open file:///C:/path/to/Wireshark User's Guide.epub. Error while opening the EPub document." 

EXPECTED RESULT

Okular should be able to open a file with U+2019 RIGHT SINGLE QUOTATION MARK in its name, such as "Wireshark User’s Guide.epub". The file opens just fine if I replace the curly quote with an apostrophe (').

SOFTWARE/OS VERSIONS
Windows: Server 2019 1809

ADDITIONAL INFORMATION

This might be due to the fact that Qt mangles command line arguments with extended characters on Windows:

https://bugreports.qt.io/browse/QTBUG-46118
https://github.com/qt/qtbase/blob/6.2/src/corelib/kernel/qcoreapplication.cpp#L172

We worked around this in Wireshark by fetching the wide version of the argument vector and converting it to UTF-8 on Windows:

https://gitlab.com/wireshark/wireshark/-/blob/0a9ef601/ui/qt/main.cpp#L562