| 206 const gchar *enclist; |
206 const gchar *enclist; |
| 207 |
207 |
| 208 enclist = gaim_account_get_string(irc->account, "encoding", IRC_DEFAULT_CHARSET); |
208 enclist = gaim_account_get_string(irc->account, "encoding", IRC_DEFAULT_CHARSET); |
| 209 encodings = g_strsplit(enclist, ",", 2); |
209 encodings = g_strsplit(enclist, ",", 2); |
| 210 |
210 |
| 211 if (encodings[0] == NULL || !strcasecmp("UTF-8", encodings[0])) |
211 if (encodings[0] == NULL || !strcasecmp("UTF-8", encodings[0])) { |
| |
212 g_strfreev(encodings); |
| 212 return g_strdup(string); |
213 return g_strdup(string); |
| |
214 } |
| 213 |
215 |
| 214 utf8 = g_convert(string, strlen(string), encodings[0], "UTF-8", NULL, NULL, &err); |
216 utf8 = g_convert(string, strlen(string), encodings[0], "UTF-8", NULL, NULL, &err); |
| 215 if (err) { |
217 if (err) { |
| 216 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Send conversion error: %s\n", err->message); |
218 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Send conversion error: %s\n", err->message); |
| 217 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Sending as UTF-8 instead of %s\n", encodings[0]); |
219 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Sending as UTF-8 instead of %s\n", encodings[0]); |