On Windows, GetSystemEncoding reports 'cp1252'. On my Linux system it reports 'ansi'. I'm not sure what I'm supposed to do with that. In the keyboard section of the control panel the character set is selected as ISO-8859-1'. That does not appear in any environment variable I can see, so there appears to be no way for a program to find it out. I guess it is yet another example of how Linux has not been properly thought out. However, Linux users are pretty used to working around stuff like this. I have added a setting to my program to allow the character encoding to be specified. It's up to the user to make it match what they are using.
I would have thought that under Windows there was a way for a program to find out the character set being used if changed on the fly from the taskbar, but I'm not up on API stuff to know how to do it. Probably no-one is going to be changing the language on the fly other than me, who was doing it just to see how the program would handle non-English characters.