GNOME Bugzilla – Bug 524314
g_convert() on WIN32 implicitly converts full width alphanumerics into half width
Last modified: 2008-04-02 02:49:49 UTC
Please describe the problem: After glib for WIN32 has switched to win_iconv, g_convert() began converting full width alphanumerics into half width implicitly. For example, g_convert("abc", -1, "ISO-8859-1", "UTF-8", NULL, &msglen, NULL) result in "abc" on WIN32 instead of NULL on other environments. This behavior is different from ever and is singular among other platforms. I think it should be normalized. Steps to reproduce: 1. Examine the returned string from g_convert() on WIN32. Actual results: In the example above, half width alphanumeric string "abc" will be returned. Expected results: NULL is expected since full width utf8 string "abc" cannot be represented in ISO-8859-1. Does this happen every time? Every time. Other information: I guess WC_NO_BEST_FIT_CHARS should be supplied as the second argument to WideCharToMultiByte().
Fixed in trunk and glib-2-16: 2008-04-02 Tor Lillqvist <tml@novell.com> Bug 524314 - g_convert() on Win32 implicitly converts full width alphanumerics into half width * glib/win_iconv.c: Update from Yukihiro Nakadaira. Use WC_NO_BEST_FIT_CHARS flag for WideCharToMultiByte() unless the //translit flag was suffixed to the codeset name. * glib/gconvert.c: Include win_iconv.c earlier so that its definition of WINVER before it includes <windows.h> is used.