GNOME Bugzilla – Bug 78197
gmessages.c calls g_convert() without checking result
Last modified: 2004-12-22 21:47:04 UTC
See bug 77341 static gchar* strdup_convert (const gchar *string, const gchar *charset) { if (!g_utf8_validate (string, -1, NULL)) return g_strconcat ("[Invalid UTF-8] ", string, NULL); else return g_convert_with_fallback (string, -1, charset, "UTF-8", "?", NULL, NULL, NULL); } Has problesm because g_convert_with_fallback() can fail even if string is valid UTF-8, though the most common reason for this would be that there is some problem with the system... e.g., that g_get_charset() is not working correctly.
*** Bug 79462 has been marked as a duplicate of this bug. ***
*** Bug 78256 has been marked as a duplicate of this bug. ***
Mon May 13 11:42:23 2002 Owen Taylor <otaylor@redhat.com> * glib/gmessages.c (strdup_convert): If g_convert_with_fallback() fails, print the error message to stderr the first time, then return the original string. (#78197)