| 112 ret = g_convert(str, len, to_charset, from_charset, &byte_read, &byte_write, &error); |
112 ret = g_convert(str, len, to_charset, from_charset, &byte_read, &byte_write, &error); |
| 113 |
113 |
| 114 if (error == NULL) |
114 if (error == NULL) |
| 115 return ret; /* conversion is OK */ |
115 return ret; /* conversion is OK */ |
| 116 else { /* conversion error */ |
116 else { /* conversion error */ |
| 117 gchar *failed = hex_dump_to_str((guint8 *) str, (len == -1) ? strlen(str) : len); |
|
| 118 purple_debug(PURPLE_DEBUG_ERROR, "QQ", "%s\n", error->message); |
117 purple_debug(PURPLE_DEBUG_ERROR, "QQ", "%s\n", error->message); |
| 119 purple_debug(PURPLE_DEBUG_WARNING, "QQ", "Dump failed text\n%s", failed); |
118 |
| 120 g_free(failed); |
119 qq_hex_dump(PURPLE_DEBUG_WARNING, "QQ", |
| |
120 (guint8 *) str, (len == -1) ? strlen(str) : len, |
| |
121 "Dump failed text"); |
| |
122 |
| 121 g_error_free(error); |
123 g_error_free(error); |
| 122 return g_strdup(QQ_NULL_MSG); |
124 return g_strdup(QQ_NULL_MSG); |
| 123 } |
125 } |
| 124 } |
126 } |
| 125 |
127 |