After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 766506 - Tools can display gibberish messages from translations
Tools can display gibberish messages from translations
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: general
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-05-16 09:00 UTC by Fan, Chun-wei
Modified: 2018-05-24 18:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Fan, Chun-wei 2016-05-16 09:00:41 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!
Comment 1 Fan, Chun-wei 2016-05-16 09:02:43 UTC
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!
Comment 2 GNOME Infrastructure Team 2018-05-24 18:54:46 UTC
-- 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.