GNOME Bugzilla – Bug 766506
Tools can display gibberish messages from translations
Last modified: 2018-05-24 18:54:46 UTC
Hi, The command-line tools included with GLib built with later versions of Visual Studio (>=2012) displays gibberish when displaying messages that are acquired from the translations. Upon some investigation, it seems that the CRT implementation of setlocale (LC_ALL, "") returns different values: msvcrt90.DLL: Chinese (Simplified)_Taiwan.950 vcruntime140.DLL: Chinese_Taiwan.936 (vcruntime140.dll is the CRT for Visual Studio 2015--Likewise for msvcr110.dll and msvcr120.dll) (My system runs on a zh_TW (Chinese (Traditional) locale, code page 950; codepage 936 refers to the codepage used in Mainland China, i.e. zh_CN, Simplified Chinese). This is obviously a CRT issue on Microsoft's side, but would affect users using translations in command-line tool programs (but interestingly, GUI programs are not affected by this issue). To fix the issues, we need to call setlocale (LC_ALL, ".ACP") in these tools to make use of the current code page correctly, in which setlocale (LC_ALL, "") was intended to do initially, according to the MSDN docs for setlocale(). I will attach patches later for this. With blessings, thank you!
Hi, We might need to update the docs in ggettext.c regarding the use of gettext() in applications, BTW, for this issue. With blessings, thank you!
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1169.