From Xojo Documentation

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

Supported for all project types and targets.

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


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.


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