diff --git a/generators/chm/lib/ebook_chm.cpp b/generators/chm/lib/ebook_chm.cpp index 98ac53346..5be570bbc 100644 --- a/generators/chm/lib/ebook_chm.cpp +++ b/generators/chm/lib/ebook_chm.cpp @@ -254,13 +254,7 @@ bool EBook_CHM::load(const QString &archiveName) } #if defined(WIN32) - // chm_open on Windows OS uses the following prototype: - // struct chmFile* chm_open(BSTR filename); - // - // however internally it simply passes the filename - // directly to CreateFileW function without any conversion. - // Thus we need to pass it as WCHAR * and not BSTR. - m_chmFile = chm_open((BSTR)filename.toStdWString().c_str()); + m_chmFile = chm_open((BSTR)QFile::encodeName(filename).constData()); #else m_chmFile = chm_open(QFile::encodeName(filename)); #endif