QTextDecoder Class

QTextDecoder クラスは、ステートベースのデコーダを提供します。詳細...

ヘッダー #include <QTextDecoder>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core5Compat)
target_link_libraries(mytarget PRIVATE Qt6::Core5Compat)
qmake: QT += core5compat

注意:このクラスの関数はすべてリエントラントです。

パブリック関数

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)

詳細説明

テキストデコーダは、特定のコーデックを使用して、エンコードされたテキスト形式から Unicode にテキストを変換します。

デコーダは、この形式のテキストを Unicode に変換し、呼び出しの間に必要な状態を記憶します。

QTextCodec::makeDecoder() およびQTextEncoderも参照

メンバ関数ドキュメント

[explicit] QTextDecoder::QTextDecoder(const QTextCodec *codec)

与えられたcodec に対するテキストデコーダを構築する。

[explicit] QTextDecoder::QTextDecoder(const QTextCodec *codec, QTextCodec::ConversionFlags flags)

与えられたcodec と変換flags 、テキストデコーダを構築する。

[noexcept] QTextDecoder::~QTextDecoder()

デコーダーを破壊する。

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

chars の最初のlen バイトを Unicode に変換し、結果を返します。

すべての文字が使用されていない場合(たとえば、マルチバイトエンコーディングの一部だけが文字の最後にある場合)、デコーダは、この関数の次の呼び出しで続行するのに十分な状態を覚えています。

QString QTextDecoder::toUnicode(const QByteArray &ba)

これはオーバーロードされた関数です。

ba で指定されたバイト配列内のバイトを Unicode に変換し、結果を返します。

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

これはオーバーロードされた関数である。

変換後の文字列はtarget で返される。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.