I was trying to install a Japanese game (Fate/Stay Night) on Windows 10, but I kept getting blue screens (not blue screens of death, just windows with weird text and blue background). The guide I used to install it said I need to change my system locale to Japanese, and that worked. But I still don’t know what a locale is and google is giving me answers I don’t understand.
In: 5
In Windows system local usually given in formats like en-US, es-ES, de-DE etc are used for a number of things. Mostly it is the language used as a default and for program that don’t properly support multilingual interfaces and Unicode text.
It also deal with date formats and how punctuation is used by default when numbers are involved.
Locale contains information about human-readable text formatting – it says, how local people read and write things: for ex., do they write dates as day/month/year, or month/day/year? Do they use 24 hour clock, or 12 hour with AM/PM? Do they use decimal point or decimal comma? What character codes are used, when they are not using Unicode?
Locale provides that information for programs, so they can present text correctly to the user. What programs should **never ever ever** do, is to use locale formatting for reading and writing its internal files.
Well, guess what: programs use locale formatting for reading and writing internal files. Which means that locale settings can change the result. `March 4th` becomes `April 3rd`. `1.234` becomes `1`, because decimal separator is set to comma. The program cannot read files from disk, because filenames use different encoding.
What’s worse, many mainstream programming frameworks just don’t care. In C/C++ there are no machine-readable formatting *at all!* You can set machine-readable locale though: it sets locale for your entire program – don’t forget to change it back! Also, if you using someone else’s code in your project – they can change the locale and not tell you. Or won’t tell you that they depend on it. But you’ll only find out this when your program leaves your home country. Happy debugging!
Latest Answers