GNOME Bugzilla – Bug 152618
Error message is broken. (gwin32.c)
Last modified: 2004-12-22 21:47:04 UTC
Please describe the problem: FormatMessage returns string. This string is encoded by CP_ACP (ANSI Code Page), If CP_ACP is Latin-1(1252), strings are displayed correctly. But if the other codepage, strings are not displayed correctly. Steps to reproduce: 1. call g_win32_error_message function Actual results: Broken string is displayed. Expected results: Returned strings have to be converted to UTF-8. Does this happen every time? every time if CP_ACP is not Latin-1(1252). Other information:
Created attachment 31546 [details] [review] convert to UTF-8 form FormatMessage
I don't know, I don't say anywhere what codeset the return value from g_win32_error_message() is in. So in theory, changing it to be UTF-8 breaks the API. But on the other hand, in the uses of this function in GDK its return value is passed to g_warning() or g_print(), so I think it's much better that it is in UTF-8, and macthes other GLib API. (It is broken even if CP_ACP is 1252, on non-English Windows installations, if the returned error message has non-ASCII in it.) Fixed in HEAD and glib-2-4.