qt-bugs@ issue : 28421 (related to 23835) applied: yes author: Waldo Bastian Index: qstring.cpp =================================================================== RCS file: /home/kde/qt-copy/src/tools/qstring.cpp,v retrieving revision 1.55 diff -u -r1.55 src/tools/qstring.cpp --- src/tools/qstring.cpp 23 Jul 2003 18:14:00 -0000 1.55 +++ src/tools/qstring.cpp 7 Aug 2003 14:41:47 -0000 @@ -5275,7 +5275,6 @@ *qch++ = QChar(0xde00+((uchar)utf8[i])); need = 0; } - error = -1; } else { if ( ch < 128 ) { *qch++ = ch; @@ -5291,10 +5290,14 @@ uc = ch & 0x07; need = 3; error = i; + } else { + // Error + *qch++ = QChar(0xdbff); + *qch++ = QChar(0xde00+((uchar)utf8[i])); } } } - if (error != -1) { + if (need) { // we have some invalid characters remaining we need to add to the string for (int i = error; i < len; ++i) { *qch++ = QChar(0xdbff);