diff options
author | Peter Hartmann <peter.hartmann@trolltech.com> | 2009-07-15 10:30:21 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@trolltech.com> | 2009-07-15 10:30:21 (GMT) |
commit | 97f82b2344334fa158f20e4ed059984fd3c43162 (patch) | |
tree | 05a38900c0409a904f45ad35b7447baef13623ed /src/corelib/codecs/qiconvcodec.cpp | |
parent | 2567ec486d5d95dc4ca06874cf75bf03bd7502b9 (diff) | |
parent | 28d0930593c6c04a7ef538353f8bee55df00a0e8 (diff) | |
download | Qt-97f82b2344334fa158f20e4ed059984fd3c43162.zip Qt-97f82b2344334fa158f20e4ed059984fd3c43162.tar.gz Qt-97f82b2344334fa158f20e4ed059984fd3c43162.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/corelib/codecs/qiconvcodec.cpp')
-rw-r--r-- | src/corelib/codecs/qiconvcodec.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp index 1bf76ea..188ac8c 100644 --- a/src/corelib/codecs/qiconvcodec.cpp +++ b/src/corelib/codecs/qiconvcodec.cpp @@ -225,10 +225,11 @@ QString QIconvCodec::convertToUnicode(const char* chars, int len, ConverterState char *inBytes = const_cast<char *>(chars); #endif + QByteArray in; if (remainingCount) { // we have to prepend the remaining bytes from the previous conversion inBytesLeft += remainingCount; - QByteArray in(inBytesLeft, Qt::Uninitialized); + in.resize(inBytesLeft); inBytes = in.data(); memcpy(in.data(), remainingBuffer, remainingCount); @@ -362,9 +363,10 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt inBytes = const_cast<char *>(reinterpret_cast<const char *>(uc)); inBytesLeft = len * sizeof(QChar); + QByteArray in; if (convState && convState->remainingChars) { // we have one surrogate char to be prepended - QByteArray in(sizeof(QChar) + len, Qt::Uninitialized); + in.resize(sizeof(QChar) + len); inBytes = in.data(); QChar remaining = convState->state_data[0]; |