summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qiconvcodec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/codecs/qiconvcodec.cpp')
-rw-r--r--src/corelib/codecs/qiconvcodec.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp
index 59c77ba..3b15d11 100644
--- a/src/corelib/codecs/qiconvcodec.cpp
+++ b/src/corelib/codecs/qiconvcodec.cpp
@@ -286,12 +286,16 @@ QString QIconvCodec::convertToUnicode(const char* chars, int len, ConverterState
}
} while (inBytesLeft != 0);
- QString s = utf16Codec->toUnicode(ba.constData(), ba.size() - outBytesLeft);
+ QString s;
if (convState) {
+ s = utf16Codec->toUnicode(ba.constData(), ba.size() - outBytesLeft, &state->internalState);
+
convState->invalidChars = invalidCount;
convState->remainingChars = remainingCount;
} else {
+ s = utf16Codec->toUnicode(ba.constData(), ba.size() - outBytesLeft);
+
// reset state
iconv(state->cd, 0, &inBytesLeft, 0, &outBytesLeft);
}