Localized console output is unreadable
Submitted by Krzysztof Kosiński
Link to original bug (#608571)
Description
GOption, and GLib in general, uses an incorrect codepage when it outputs localized messages to the console. It uses the system codepage, but the console codepage can be different. (Yes this is braindead.) This results in funky characters being output instead of diacritics.
For example on a Polish version of Windows, the system codepage is 1250 but the console codepage is 852. Polish GLib and GOption messages do not display correctly until I execute "chcp 1250" in the shell.
To fix this, GOption / GLib should call SetConsoleOutputCP to change the console page to match the system codepage before outputting any messages. It's best to call this both in GOption and somewhere from GLib initialization functions, because calling it multiple times doesn't do any harm.