My application for macOS archives emails from email clients and IMAP accounts. One user got an email from a Windows user and archived the email from Mail. My app reads the data directly from the hard disk.
The user has an email with some a nice mojibake:
I can identify a few of the characters:
‰ → ä ¸ → ü
But I can't figure out whhat the original encoding is. I made myself an encoding table for the characters "ö ä ü ß" and my data is not in that table:
Code:
dim theLeft as string = "ö ä ü ß"
for currentEncoding as integer = 0 to Encodings.Count - 1
dim EncodingInternetName as String = Encodings.Item(currentEncoding).internetName
if EncodingInternetName.IndexOf("iso") = -1 and EncodingInternetName.IndexOf("windows") = -1 then Continue
dim newString as string = DefineEncoding(theLeft, Encodings.Item(currentEncoding)) '<---convert
newString = ConvertEncoding(newString, Encodings.UTF8)
Result.Add(EncodingInternetName + " " + newString)
next
Does anyone have an idea what encoding was used for the Mojibake?