summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-03-25 20:33:07 +0100
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-03-27 12:08:32 +0100
commit811eb47c3501479033ac3a484beeb896b6c0753f (patch)
tree6d631c9dfe0e0056b8e16ce5d23a8992f41decd5 /tools/linguist/shared
parent6ac130466400197b8977f60d14ed96abfb0d2172 (diff)
avoid empty codec name
Diffstat (limited to 'tools/linguist/shared')
-rw-r--r--tools/linguist/shared/translator.cpp2
-rw-r--r--tools/linguist/shared/ts.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/tools/linguist/shared/translator.cpp b/tools/linguist/shared/translator.cpp
index 6ae8059aec..32404a5f7a 100644
--- a/tools/linguist/shared/translator.cpp
+++ b/tools/linguist/shared/translator.cpp
@@ -545,7 +545,7 @@ void Translator::setCodecName(const QByteArray &name)
if (!codec) {
if (!name.isEmpty())
qWarning("No QTextCodec for %s available. Using Latin1\n", name.constData());
- m_codecName.clear();
+ m_codecName = "ISO-8859-1";
} else {
m_codecName = codec->name();
}
diff --git a/tools/linguist/shared/ts.cpp b/tools/linguist/shared/ts.cpp
index d454e4ebd1..3af9e593c6 100644
--- a/tools/linguist/shared/ts.cpp
+++ b/tools/linguist/shared/ts.cpp
@@ -277,7 +277,9 @@ bool TSReader::read(Translator &translator)
// ignore these, just whitespace
} else if (elementStarts(strdefaultcodec)) {
// <defaultcodec>
- translator.setCodecName(readElementText().toLatin1());
+ const QString &codec = readElementText();
+ if (!codec.isEmpty())
+ translator.setCodecName(codec.toLatin1());
// </defaultcodec>
} else if (isStartElement()
&& name().toString().startsWith(strextrans)) {