diff options
Diffstat (limited to 'src/corelib/codecs')
-rw-r--r-- | src/corelib/codecs/qicucodec.cpp | 2 | ||||
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 23 | ||||
-rw-r--r-- | src/corelib/codecs/qwindowscodec.cpp | 4 |
3 files changed, 23 insertions, 6 deletions
diff --git a/src/corelib/codecs/qicucodec.cpp b/src/corelib/codecs/qicucodec.cpp index 65cc337708..b375999aeb 100644 --- a/src/corelib/codecs/qicucodec.cpp +++ b/src/corelib/codecs/qicucodec.cpp @@ -121,7 +121,7 @@ struct MibToName { short index; }; -static MibToName mibToName[] = { +static const MibToName mibToName[] = { { 3, 0 }, { 4, 9 }, { 5, 20 }, diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 050f8f207f..8fef333a77 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -1147,13 +1147,30 @@ QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba) return codecForUtfText(ba, QTextCodec::codecForMib(/*Latin 1*/ 4)); } +/*! + \fn QTextCodec * QTextCodec::codecForTr () + \obsolete + + Returns the codec used by QObject::tr() on its argument. If this + function returns 0 (the default), tr() assumes Latin-1. + + \sa setCodecForTr() +*/ + +/*! + \fn QTextCodec::setCodecForTr ( QTextCodec * c ) + \obsolete + + Sets the codec used by QObject::tr() on its argument to c. If c + is 0 (the default), tr() assumes Latin-1. +*/ /*! \internal \since 4.3 - Determines whether the decoder encountered a failure while decoding the input. If - an error was encountered, the produced result is undefined, and gets converted as according - to the conversion flags. + Determines whether the decoder encountered a failure while decoding the + input. If an error was encountered, the produced result is undefined, and + gets converted as according to the conversion flags. */ bool QTextDecoder::hasFailure() const { diff --git a/src/corelib/codecs/qwindowscodec.cpp b/src/corelib/codecs/qwindowscodec.cpp index cf427c64b6..dded93ccb5 100644 --- a/src/corelib/codecs/qwindowscodec.cpp +++ b/src/corelib/codecs/qwindowscodec.cpp @@ -172,7 +172,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le } #else QString s; - int size = mbstowcs(NULL, mb, length); + size_t size = mbstowcs(NULL, mb, length); if (size < 0) { Q_ASSERT("Error in CE TextCodec"); return QString(); @@ -181,7 +181,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le ws[size +1] = 0; ws[size] = 0; size = mbstowcs(ws, mb, length); - for (int i=0; i< size; i++) + for (size_t i = 0; i < size; i++) s.append(QChar(ws[i])); delete [] ws; #endif |