diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-17 17:41:23 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-07-17 17:43:50 (GMT) |
commit | 1185386dfe9727ed591da442e97084907f0a6735 (patch) | |
tree | df4a70d8132e4f2d3005160c68130a2c176e5636 /tools/linguist/shared/qm.cpp | |
parent | 74c0b4300b538b24c56abf2be2d5e09b9c59a845 (diff) | |
download | Qt-1185386dfe9727ed591da442e97084907f0a6735.zip Qt-1185386dfe9727ed591da442e97084907f0a6735.tar.gz Qt-1185386dfe9727ed591da442e97084907f0a6735.tar.bz2 |
don't rely on system codec when handling PO files
- make -input-codec affect PO files, default to UTF-8
- add -output-codec for PO files, same default
Diffstat (limited to 'tools/linguist/shared/qm.cpp')
-rw-r--r-- | tools/linguist/shared/qm.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp index 323bd29..381f5c5 100644 --- a/tools/linguist/shared/qm.cpp +++ b/tools/linguist/shared/qm.cpp @@ -545,7 +545,8 @@ bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd) size_t numItems = offsetLength / (2 * sizeof(quint32)); //qDebug() << "NUMITEMS: " << numItems; - QTextCodec *codec = QTextCodec::codecForName(cd.m_codecForSource); + QTextCodec *codec = QTextCodec::codecForName( + cd.m_codecForSource.isEmpty() ? "Latin1" : cd.m_codecForSource); QTextCodec *utf8Codec = 0; if (codec->name() != "UTF-8") utf8Codec = QTextCodec::codecForName("UTF-8"); |