summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2018-10-20 21:28:17 -0700
committerThiago Macieira <thiago.macieira@intel.com>2018-11-08 15:19:53 +0000
commit66a2d159073bfbeec53a0b9e09575c3fe9beac8d (patch)
tree9b7f04eae2952c97eb3fb2bd4c4595627a74f01b /src/corelib/codecs
parent570ef11c28b885817a69523835fac40d9e0d1f4e (diff)
QTextCodec: update the docs for codecForUtfText
It can detect the standard UTF codecs, but not non-standard like UTF-7[1], UTF-9 or UTF-18[2]. [1] https://tools.ietf.org/html/rfc2152 [2] https://tools.ietf.org/html/rfc4042 Fixes: QTBUG-67188 Change-Id: If7e743cf8476463880ccfffd155f853dc947421a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/codecs')
-rw-r--r--src/corelib/codecs/qtextcodec.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index fedd39e104..a2a128158e 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -1164,9 +1164,19 @@ QTextCodec *QTextCodec::codecForHtml(const QByteArray &ba)
Tries to detect the encoding of the provided snippet \a ba by
using the BOM (Byte Order Mark) and returns a QTextCodec instance
- that is capable of decoding the text to unicode. If the codec
- cannot be detected from the content provided, \a defaultCodec is
- returned.
+ that is capable of decoding the text to unicode. This function can
+ detect one of the following codecs:
+
+ \list
+ \li UTF-32 Little Endian
+ \li UTF-32 Big Endian
+ \li UTF-16 Little Endian
+ \li UTF-16 Big Endian
+ \li UTF-8
+ \endlist
+
+ If the codec cannot be detected from the content provided, \a defaultCodec
+ is returned.
\sa codecForHtml()
*/
@@ -1209,8 +1219,19 @@ QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba, QTextCodec *defaul
Tries to detect the encoding of the provided snippet \a ba by
using the BOM (Byte Order Mark) and returns a QTextCodec instance
- that is capable of decoding the text to unicode. If the codec
- cannot be detected, this overload returns a Latin-1 QTextCodec.
+ that is capable of decoding the text to unicode. This function can
+ detect one of the following codecs:
+
+ \list
+ \li UTF-32 Little Endian
+ \li UTF-32 Big Endian
+ \li UTF-16 Little Endian
+ \li UTF-16 Big Endian
+ \li UTF-8
+ \endlist
+
+ If the codec cannot be detected from the content provided, this overload
+ returns a Latin-1 QTextCodec.
\sa codecForHtml()
*/