QTextDecoder 類

The QTextDecoder class provides a state-based decoder. 更多...

頭: #include <QTextDecoder>
qmake: QT += core

注意: 此類的所有函數 可重入 .

公共函數

QTextDecoder (const QTextCodec * codec )
QTextDecoder (const QTextCodec * codec , QTextCodec::ConversionFlags flags )
~QTextDecoder ()
QString toUnicode (const char * chars , int len )
QString toUnicode (const QByteArray & ba )
void toUnicode (QString * target , const char * chars , int len )

詳細描述

The QTextDecoder class provides a state-based decoder.

文本解碼器使用特定編解碼器,將文本從編碼文本格式轉換成 Unicode。

解碼器將在此格式的文本轉換成 Unicode,記住:在調用之間要求任何狀態。

另請參閱 QTextCodec::makeDecoder () 和 QTextEncoder .

成員函數文檔編製

QTextDecoder:: QTextDecoder (const QTextCodec * codec )

構造文本解碼器為給定 codec .

QTextDecoder:: QTextDecoder (const QTextCodec * codec , QTextCodec::ConversionFlags flags )

構造文本解碼器為給定 codec 和轉換 flags .

該函數在 Qt 4.7 引入。

QTextDecoder:: ~QTextDecoder ()

銷毀解碼器。

QString QTextDecoder:: toUnicode (const char * chars , int len )

轉換第一 len 字節在 chars 到 Unicode,返迴結果。

若未使用所有字符 (如:若僅部分多字節編碼位於字符末尾),解碼器將記住足夠狀態以繼續此函數的下一調用。

QString QTextDecoder:: toUnicode (const QByteArray & ba )

這是重載函數。

轉換在字節數組中的字節指定通過 ba 到 Unicode 並返迴結果。

void QTextDecoder:: toUnicode ( QString * target , const char * chars , int len )

這是重載函數。

返迴的轉換字符串在 target .