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 152618 - Error message is broken. (gwin32.c)
Error message is broken. (gwin32.c)
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
unspecified
Other All
: Normal minor
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2004-09-14 15:14 UTC by Kazuki Iwamoto
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
convert to UTF-8 form FormatMessage (612 bytes, patch)
2004-09-14 15:17 UTC, Kazuki Iwamoto
none Details | Review

Description Kazuki Iwamoto 2004-09-14 15:14:52 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:
Comment 1 Kazuki Iwamoto 2004-09-14 15:17:05 UTC
Created attachment 31546 [details] [review]
convert to UTF-8 form FormatMessage
Comment 2 Tor Lillqvist 2004-09-15 19:12:49 UTC
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.