Browse Source

include missing text codecs to improve support for Asian languages

According to https://qt-project.org/doc/qt-4.8/plugins-howto.html#static-plugins
you need to explicitly link against the text codecs when you are
using a static version of Qt. This will enable support for the
Chinese (Simplified/Traditional), Japanese and Korean languages
and will fix #1764
Ashish Kulkarni 11 years ago
parent
commit
3ac41fae4b
3 changed files with 11 additions and 0 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 0
      common.pri
  3. 9 0
      src/lib/converter.cc

+ 1 - 0
CHANGELOG.md

@@ -15,6 +15,7 @@ v0.12.1 (unreleased)
 * **#1631**: **[qt]** crash when hiding header for a specific page
 * **#1686**: **[qt]** --user-style-sheet does not work on Windows
 * **#1757**: fix parsing of ColorMode and PrinterMode in the API
+* **#1764**: include text codecs for Chinese (Simplified/Traditional), Japanese and Korean
 * fix compilation failures when not building with patched Qt/WebKit
 * support building with non-patched Qt4/Qt5 in either shared or static mode
 * implement a --license command line option

+ 1 - 0
common.pri

@@ -31,6 +31,7 @@ qt_gui_prl_found {
     contains(QMAKE_PRL_CONFIG, static): DEFINES += QT_STATIC
     else:                               DEFINES += QT_SHARED
 }
+contains(QMAKE_PRL_CONFIG, static): QTPLUGIN += qcncodecs qjpcodecs qkrcodecs qtwcodecs
 
 # if we can't determine, assume that it is shared
 !qt_gui_prl_found: DEFINES += QT_SHARED

+ 9 - 0
src/lib/converter.cc

@@ -23,6 +23,15 @@
 #include "multipageloader.hh"
 #include <QWebFrame>
 #include <qapplication.h>
+
+#ifdef QT_STATIC
+#include <QtPlugin>
+Q_IMPORT_PLUGIN(qcncodecs)
+Q_IMPORT_PLUGIN(qjpcodecs)
+Q_IMPORT_PLUGIN(qkrcodecs)
+Q_IMPORT_PLUGIN(qtwcodecs)
+#endif
+
 namespace wkhtmltopdf {