内容表

上一话题

QTextCodec

下一话题

QTextEncoder

QTextDecoder

QTextDecoder class provides a state-based decoder. 更多

Inheritance diagram of PySide2.QtCore.QTextDecoder

概要

详细描述

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.

class QTextDecoder ( codec )

QTextDecoder(codec, flags)

param codec

QTextCodec

param flags

ConversionFlags

Constructs a text decoder for the given codec .

Constructs a text decoder for the given codec and conversion flags .

PySide2.QtCore.QTextDecoder. hasFailure ( )
返回类型

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 ( )
返回类型

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 )
参数

ba QByteArray

返回类型

unicode

这是重载函数。

Converts the bytes in the byte array specified by ba to Unicode and returns the result.