IOChannel.setEncoding

Sets the encoding for the input/output of the channel. The internal encoding is always UTF-8. The default encoding for the external file is UTF-8.

The encoding null is safe to use with binary data.

The encoding can only be set if one of the following conditions is true:

Channels which do not meet one of the above conditions cannot call glib.iochannel.IOChannel.seekPosition with an offset of G_SEEK_CUR, and, if they are "seekable", cannot call glib.iochannel.IOChannel.writeChars after calling one of the API "read" functions.

class IOChannel
setEncoding
(
string encoding = null
)

Parameters

encoding string

the encoding type

Return Value

Type: glib.types.IOStatus

G_IO_STATUS_NORMAL if the encoding was successfully set