Table Of Contents

Previous topic

QTextDecoder

Next topic

QTextCodec

QTextEncoder

Inheritance diagram of QTextEncoder

Synopsis

Functions

Detailed Description

The PySide.QtCore.QTextEncoder class provides a state-based encoder.

A text encoder converts text from Unicode into an encoded text format using a specific codec.

The encoder converts Unicode into another format, remembering any state that is required between calls.

class PySide.QtCore.QTextEncoder(codec)
class PySide.QtCore.QTextEncoder(codec, flags)
Parameters:

Constructs a text encoder for the given codec .

PySide.QtCore.QTextEncoder.fromUnicode(str)
Parameters:str – unicode
Return type:PySide.QtCore.QByteArray

Converts the Unicode string str into an encoded PySide.QtCore.QByteArray .

PySide.QtCore.QTextEncoder.hasFailure()
Return type:PySide.QtCore.bool

Determines whether the eecoder 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.