For your current mail.txt all that is necessary is
Var txt As String = mail
Var utf8_OK As String = txt.DefineEncoding(Encodings.ISOLatin9)_
.ConvertEncoding(Encodings.UTF8)
For your current mail.txt all that is necessary is
Var txt As String = mail
Var utf8_OK As String = txt.DefineEncoding(Encodings.ISOLatin9)_
.ConvertEncoding(Encodings.UTF8)
I had a look at this.
The first thing I noted was, that you added the mail.text file as an object in your project. There it is treated as UTF-8. The file contents is Windows ANSI / cp1252 / iso-8859-1 / iso-8859-15.
It is not QuotedPrintable encoded. Decode it as such does not do any harm in this particular case, but it could easily do, if for example the amount is different: 2 x Bett Guest (ga.10708.11006) =3.890,00 EUR
. Let it be 5 x Bett ... =11.670,00 EUR
and the =11
will be converted to a (vertical tab character).
Then I had a look at MojiBakeText. I don’t know if I can trust what I find there, because, as you said,
Anyway, as it is, it looks like twice encoded UTF-8 (talking about the encoding scheme here, only, not about if it was feasible to interpret the resulting byte stream as unicode codepoints). It turns out, however, that the byte stream is not a valid stream resulting from an UTF-8 encoding at all. It is invalid here:
I do not know of any encoding, or text encoding conversion, that could lead to that zero-byte from ‘ß’ (or maybe ‘öß’), unless it was lossy and has no sensible replacement character. Recovering from here needed heuristics or a custom conversion. No standard conversion can fix this.
When I run this code
Var f As FolderItem = SpecialFolder.Documents.Child("mail.txt")
Var t As TextInputStream = TextInputStream.Open(f)
t.Encoding = Encodings.WindowsANSI
TextArea1.Text = t.ReadAll.ConvertEncoding(Encodings.UTF8)
t.Close
In the opening event of my window I see this output
Which looks fine to me.
As said here
You may prefer IsoLatin9 because it’s like IsoLatin1, WindowsANSI, Windows1252… BUT includes the new Euro sign