diff options
author | Volker Hilsheimer <volker.hilsheimer@nokia.com> | 2009-07-20 15:26:15 (GMT) |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@nokia.com> | 2009-07-20 15:31:54 (GMT) |
commit | 52bc8a751aa5b02028aaef915ac7a97664acb747 (patch) | |
tree | 3b49797f67c049558b86f054551fa63499863863 /src/corelib/codecs | |
parent | 19c5938da4832fc5a92d55e69c201b408a329517 (diff) | |
download | Qt-52bc8a751aa5b02028aaef915ac7a97664acb747.zip Qt-52bc8a751aa5b02028aaef915ac7a97664acb747.tar.gz Qt-52bc8a751aa5b02028aaef915ac7a97664acb747.tar.bz2 |
Doc: small improvements
Diffstat (limited to 'src/corelib/codecs')
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index bdf7cd5..f49e34a 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -1536,9 +1536,13 @@ QTextCodec *QTextCodec::codecForHtml(const QByteArray &ba, QTextCodec *defaultCo } /*! - \overload + \overload - If the codec cannot be detected, this overload returns a Latin-1 QTextCodec. + Tries to detect the encoding of the provided snippet of HTML in + the given byte array, \a ba, by checking the BOM (Byte Order Mark) + and the content-type meta header and returns a QTextCodec instance + that is capable of decoding the html to unicode. If the codec cannot + be detected, this overload returns a Latin-1 QTextCodec. */ QTextCodec *QTextCodec::codecForHtml(const QByteArray &ba) { @@ -1550,10 +1554,13 @@ 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 + that is capable of decoding the text to unicode. If the codec cannot be detected from the content provided, \a defaultCodec is returned. + The behavior of this function is undefined if \a ba is not + encoded in unicode. + \sa codecForHtml() */ QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba, QTextCodec *defaultCodec) @@ -1591,9 +1598,17 @@ QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba, QTextCodec *defaul } /*! - \overload + \overload + + 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. + + The behavior of this function is undefined if \a ba is not + encoded in unicode. - If the codec cannot be detected, this overload returns a Latin-1 QTextCodec. + \sa codecForHtml() */ QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba) { |