utf8: report allocation error
authorMarc-André Lureau <marcandre.lureau@gmail.com>
Wed, 6 Nov 2013 11:21:58 +0000 (12:21 +0100)
committerMarc-André Lureau <marcandre.lureau@gmail.com>
Mon, 25 Nov 2013 11:07:57 +0000 (12:07 +0100)
commitd6a19d2e76654570c056ef328c6fb4fdda939272
tree882d5d6a12631c973d9f6c09866d99a70bbe355d
parent0dbe5c43df6d3eb32abe766ed08da525a8c8bfa4
utf8: report allocation error

Make some of the conversion functions a bit more friendly to allocation
failure.

Even though the glib policy is to abort() on allocation failure by
default, it can be quite helpful to return an allocation error for
functions already providing a GError.

I needed a safer g_utf16_to_utf8() to solve crash on big clipboard
operations with win32, related to rhbz#1017250 (and coming gdk handling
bug).

https://bugzilla.gnome.org/show_bug.cgi?id=711546
glib/gconvert.h
glib/gutf8.c