I tried various ways, but none of them worked.
(Like adding a 2nd parameter to SaveToFile or settting TStringList.DefaultEncoding / TStringList.Encoding.)
So how do I set the encoding for TStringList SaveToFile, so I can save in specific ANSI/UTF-8 formats?
Text in editor before I copy it to TStringList and save it using SaveToFile:
- Code: Select all
.test {
content: "bøllehår";
}
Then when I load the content back into TStringList using LoadFromFile and paste it back in editor, it looks like this:
- Code: Select all
.test {
content: "b�lleh�r";
}
Both extended characters ("ø" and "å") are turned into the SAME 3 character sequence ("�", hex: EF BF BD). So it's not possible to fix it "manually" either.
Doesn't matter if the content in editor is ANSI or UTF-8. Both produces the same buggy result.