Since I cant post there
@Alberto
re : (https://forum.xojo.com/conversation/post/490074)
Create a new module
Add an extension method for TextOutputStream
Sub writeEncoded(extends tos as Textoutputstream, value as string)
tos.encoding = value.Encoding
tos.write value
end sub
now you could probably write ANY number of different encodings into a file but it would be a mess without some other meta data being written into the file to know what encoding you are about to read / write
an alternative would be to write this extensions as
sub writeEncoded(extends tos as Textoutputstream, value as string)
if tos.encoding is nil then
tos.write value
else
tos.write ConvertEncoding(value, tos.encoding)
end if
end sub