TextInputStream.Encoding

From Xojo Documentation

Property (As TextEncoding )
aTextInputStream.Encoding = newTextEncodingValue
or
TextEncodingValue = aTextInputStream.Encoding

Supported for all project types and targets.

Specifies the encoding to be defined for a string returned by ReadLine or ReadAll.

Notes

It does not actually convert the bytes, but only assigns them an encoding, as if you had called DefineEncoding. Use the Encoding object to specify the TextEncoding. It defaults to UTF-8, but you can assign it a different encoding to match your file, or even assign Nil if you want the string to have an undefined encoding.

Example

This example sets the encoding for a file:

Var f As FolderItem = SpecialFolder.Documents.Child("test.txt")
Var t As TextInputStream = TextInputStream.Open(f)
t.Encoding = Encodings.UTF8