When you read / write data containing Windows codepage, you must convert to / from Unicode ASAP. Please read and understand this :
https://wiki.lazarus.freepascal.org/Unicode_Support_in_Lazarus#Reading_.2F_writing_text_file_with_Windows_codepage
Thanks for that link. I looked into it and added it to my list where I collect infos about UTF8 related things if I might need it one day.
Ok, I will ask in a different way: Why do you want to use Windows codepages?
It's not my declared goal to use Windows charsets everywhere. But great parts of my sources rely on a specific charset (for which they had been written and tested): all my sources for lots of programs including many common units have grown up over nearly 35 years (I started with Turbo Pascal 3). Great parts of this sources would not work with UTF8.
For me it is important, that I do not loose
enormous time by changing things, which had already been finished including costly testing (!) and which work perfectly, as long as there is no real need. Because I'm only a hobbyist and unfortunately the time for each hobby is limited :-((
For decades they have been a source of pain and sorrow and texts with question marks ('?????????') when transferred between locales.
I had some cases in the past, but I solved them long time ago. That means, this is definitely not my problem. But this is funny: when I *included* unit LazUTF8, one of the problems which you did not want to read was, that in some cases '???' instead of 'äöü' etc. appeared. But only *with* this unit and definitely *never* without this unit.
Please let us stop this discussion now. You did not want to read some examples of the problems which I faced with unit LazUTF8 - which of course is free to you - but then all its disadvantages for me might not be comprehensible to you.
I highly appreciate this forum (including your part) for changing technical informations e.g. what is possible or how something can made working. But please allow, that I want to be the one who decides which of 2 possible solutions I would prefer in my personal situation, because I am the one who has to shoulder the resulting work.