QTextDecoder Class
La classe `QTextDecoder` fournit un décodeur à états. En savoir plus...
| En-tête : | #include <QTextDecoder> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS Core5Compat) target_link_libraries(mytarget PRIVATE Qt6::Core5Compat) |
| qmake : | QT += core5compat |
Remarque : toutes les fonctions de cette classe sont réentrantes.
Fonctions publiques
| QTextDecoder(const QTextCodec *codec) | |
| QTextDecoder(const QTextCodec *codec, int flags) | |
| ~QTextDecoder() | |
| QString | toUnicode(const char *chars, int len) |
| QString | toUnicode(const QByteArray &ba) |
| void | toUnicode(QString *target, const char *chars, int len) |
Description détaillée
Un décodeur de texte convertit un texte au format codé en Unicode à l'aide d'un codec spécifique.
Le décodeur convertit le texte dans ce format en Unicode, en conservant tout état requis entre les appels.
Voir également QTextCodec::makeDecoder() et QTextEncoder.
Documentation des fonctions membres
[explicit] QTextDecoder::QTextDecoder(const QTextCodec *codec)
Crée un décodeur de texte pour l'codec.
[explicit] QTextDecoder::QTextDecoder(const QTextCodec *codec, int flags)
Crée un décodeur de texte pour l'codec et la conversion flags données.
[noexcept] QTextDecoder::~QTextDecoder()
Détruit le décodeur.
QString QTextDecoder::toUnicode(const char *chars, int len)
Convertit les premiers len octets de chars au format Unicode, puis renvoie le résultat.
Si tous les caractères ne sont pas utilisés (par exemple, si seule une partie d’un encodage multioctet se trouve à la fin des caractères), le décodeur mémorise suffisamment d’informations d’état pour poursuivre l’exécution lors du prochain appel à cette fonction.
QString QTextDecoder::toUnicode(const QByteArray &ba)
Convertit les octets du tableau d'octets spécifié par ` ba ` au format Unicode et renvoie le résultat.
Il s'agit d'une fonction surchargée.
void QTextDecoder::toUnicode(QString *target, const char *chars, int len)
La chaîne convertie est renvoyée dans ` target`.
Il s'agit d'une fonction surchargée.
© 2026 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.