As we know, in windows system, we can set locale language for non-Unicode programs in “Control Panel\Clock, Language, and Region”. But what does a local language mean for an application? Since to my understanding, an application is a compiled binary executable file, which only contained machine code instructions and no data, so how the character encoding affect their running?
One guess is if the executable file contain some literal strings in code segment, it will use some internal Charset to encoding them. If the charset is not unicode, then it will display garbage. But is not the internal Charset is a fixed one? Just like in Java, java spec defines the internal encoding is UTF-16.
Hope someone can answer my questions,
Thanks.
Windows has two methods by which programs can talk to it, called the “ANSI API” and the “Unicode API”, and a “non-unicode application” is one that talks to Windows via the “ANSI API” rather than the “Unicode API”.
What that means is that any string that the application passes to Windows is just a sequence of bytes, not a sequence of Unicode characters. Windows has to decide which characters that sequence of bytes corresponds with, and the Control Panel setting you’re talking about is how it does that.
So for example, a non-unicode program that outputs a byte with value 0xE4 on a PC set to use Windows Western will display the character ä, whereas one set up for Hebrew will display the character ה.