Index: abiword-2.9.2+svn20120603/src/af/util/xp/ut_iconv.cpp =================================================================== --- abiword-2.9.2+svn20120603.orig/src/af/util/xp/ut_iconv.cpp 2012-06-04 13:20:42.000000000 +0800 +++ abiword-2.9.2+svn20120603/src/af/util/xp/ut_iconv.cpp 2012-08-13 01:27:24.090959368 +0800 @@ -355,11 +355,37 @@ UT_uint32* bytes_written_arg) { gsize _bytes_read = 0, _bytes_written = 0; - char* result = g_convert(str, len, to_codeset, from_codeset, &_bytes_read, &_bytes_written, NULL); + GError *convert_error = NULL; + char* result = g_convert(str, len, to_codeset, from_codeset, &_bytes_read, &_bytes_written, &convert_error); if (bytes_read_arg) *bytes_read_arg = _bytes_read; if (bytes_written_arg) *bytes_written_arg = _bytes_written; + if (!result && convert_error) { + gchar *strhex=NULL; + int i; + for (i=0; (i==-1)?(str[i] != '\0'):(imessage)); + if (strhex) { + g_free(strhex); + strhex = NULL; + } + } + if (convert_error) { + g_error_free(convert_error); + convert_error = NULL; + } return result; }