setEncoding

Synopsis

setEncoding($handle, "charset name")

sets the character set to encode/decode written/read characters with the specified handle.

Parameters

$handle - the handle to set the encoding for.

"charset name" - the unicode character set.

Returns

A $handle to the file. This handle can be read from and written to using Sleep's IO functions.

Examples

$handle = openf("data.cp437.txt"); setEncoding($handle, "cp437"); println("Read: " . readc($handle));

Read: a

See Also