|  | Home · All Classes · Modules

# QTextEncoder Class Reference
[QtCore module]

The QTextEncoder class provides a state-based encoder. More...

### Methods

- __init__ (self, QTextCodec codec)
- QByteArray fromUnicode (self, QString str)

## Detailed Description

The 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.

See also QTextCodec.makeEncoder() and QTextDecoder.

## Method Documentation

### QTextEncoder.__init__ (self, QTextCodec codec)

Constructs a text encoder for the given codec.

### QByteArray QTextEncoder.fromUnicode (self, QString str)

Converts the Unicode string str into an encoded QByteArray.