equal
deleted
inserted
replaced
1571 using the BOM (Byte Order Mark) and returns a QTextCodec instance |
1571 using the BOM (Byte Order Mark) and returns a QTextCodec instance |
1572 that is capable of decoding the text to unicode. If the codec |
1572 that is capable of decoding the text to unicode. If the codec |
1573 cannot be detected from the content provided, \a defaultCodec is |
1573 cannot be detected from the content provided, \a defaultCodec is |
1574 returned. |
1574 returned. |
1575 |
1575 |
1576 The behavior of this function is undefined if \a ba is not |
|
1577 encoded in unicode. |
|
1578 |
|
1579 \sa codecForHtml() |
1576 \sa codecForHtml() |
1580 */ |
1577 */ |
1581 QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba, QTextCodec *defaultCodec) |
1578 QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba, QTextCodec *defaultCodec) |
1582 { |
1579 { |
1583 const int arraySize = ba.size(); |
1580 const int arraySize = ba.size(); |
1618 Tries to detect the encoding of the provided snippet \a ba by |
1615 Tries to detect the encoding of the provided snippet \a ba by |
1619 using the BOM (Byte Order Mark) and returns a QTextCodec instance |
1616 using the BOM (Byte Order Mark) and returns a QTextCodec instance |
1620 that is capable of decoding the text to unicode. If the codec |
1617 that is capable of decoding the text to unicode. If the codec |
1621 cannot be detected, this overload returns a Latin-1 QTextCodec. |
1618 cannot be detected, this overload returns a Latin-1 QTextCodec. |
1622 |
1619 |
1623 The behavior of this function is undefined if \a ba is not |
|
1624 encoded in unicode. |
|
1625 |
|
1626 \sa codecForHtml() |
1620 \sa codecForHtml() |
1627 */ |
1621 */ |
1628 QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba) |
1622 QTextCodec *QTextCodec::codecForUtfText(const QByteArray &ba) |
1629 { |
1623 { |
1630 return codecForUtfText(ba, QTextCodec::codecForMib(/*Latin 1*/ 4)); |
1624 return codecForUtfText(ba, QTextCodec::codecForMib(/*Latin 1*/ 4)); |