QTextDecoder¶
The
QTextDecoder
class provides a state-based decoder. More…
Synopsis¶
Functions¶
def
hasFailure
()def
needsMoreData
()def
toUnicode
(ba)
Detailed Description¶
A text decoder converts text from an encoded text format into Unicode using a specific codec.
The decoder converts text in this format into Unicode, remembering any state that is required between calls.
See also
- class PySide2.QtCore.QTextDecoder(codec)¶
PySide2.QtCore.QTextDecoder(codec, flags)
- param codec:
- param flags:
ConversionFlags
Constructs a text decoder for the given
codec
.Constructs a text decoder for the given
codec
and conversionflags
.
- PySide2.QtCore.QTextDecoder.hasFailure()¶
- Return type:
bool
Determines whether the decoder encountered a failure while decoding the input. If an error was encountered, the produced result is undefined, and gets converted as according to the conversion flags.
- PySide2.QtCore.QTextDecoder.needsMoreData()¶
- Return type:
bool
Determines whether the decoder needs more bytes to continue decoding. That is, this signifies that the input string ended in the middle of a multi-byte sequence. Note that it’s possible some codecs do not report this.
- PySide2.QtCore.QTextDecoder.toUnicode(ba)¶
- Parameters:
- Return type:
str
This is an overloaded function.
Converts the bytes in the byte array specified by
ba
to Unicode and returns the result.
© 2022 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.