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

BUGS: 448274
remotes/origin/release/21.12 v21.12.2
Albert Astals Cid 4 years ago
parent feef900250
commit 5d1d412092
  1. 4
      generators/epub/epubdocument.cpp

@ -18,7 +18,11 @@ EpubDocument::EpubDocument(const QString &fileName, const QFont &font)
, padding(20)
, mFont(font)
{
#ifdef Q_OS_WIN
mEpub = epub_open(fileName.toUtf8(), 2);
#else
mEpub = epub_open(qPrintable(fileName), 2);
#endif
setPageSize(QSizeF(600, 800));
}

Loading…
Cancel
Save