[quote=478127:@Dodo Hunziker]{\rtf1\adeflang1025\ansi\ansicpg1251\uc1\adeff31507\deff0\… // <— this one is not working
[/quote]
cp1251 is Encodings.WindowsCyrilic.
I would expect this to work for a file with that encoding:
t = TextInputStream.Open(f)
t.Encoding = Encodings.WindowsCyrillic
TextArea1.StyledText.RTFData = t.ReadAll
I think you should check TextArea1.Value.Encoding.InternetName, not Format.
It looks like Xojo is not processing \u correctly.
\u was designed to allow a number of ANSI characters to follow the command so that non-Unicode compliant RTF readers could display something. Unicode compliant readers skip those characters.
The number of characters is controlled by the \uc command. If \uc isn’t present then 1 should be assumed.
This means that all of the \'3f characters following the \u command should be getting skipped but they aren’t.
@Emile Schwarz - Your example works because there are no characters to skip (\uc0).
so… Once you have solved the problem with reading the data from the file you might have to solve this one next.