# HG changeset patch # User Yoshiki Yazawa # Date 1213182322 0 # Node ID ae2cc2905136f9b7dd31f31e8aacb1efc6e1fd10 # Parent f473058e38392fb87c053482b2722aebca0a7272 clean yahoo/util.c up. diff -r f473058e3839 -r ae2cc2905136 libpurple/protocols/yahoo/util.c --- a/libpurple/protocols/yahoo/util.c Wed Jun 11 10:23:29 2008 +0000 +++ b/libpurple/protocols/yahoo/util.c Wed Jun 11 11:05:22 2008 +0000 @@ -116,12 +116,13 @@ gsize newlen; const char *to_codeset; - if (utf8 && *utf8) { + if (yd->jp || (utf8 && *utf8)) { return botch_utf((gchar *)str, strlen((gchar *)str), &newlen); } to_codeset = purple_account_get_string(purple_connection_get_account(gc), "local_charset", "ISO-8859-1"); ret = g_convert_with_fallback(str, -1, to_codeset, "UTF-8", "?", NULL, NULL, NULL); + if (ret) return ret; else @@ -154,9 +155,9 @@ else from_codeset = purple_account_get_string(purple_connection_get_account(gc), "local_charset", "ISO-8859-1"); - ret = g_convert_with_fallback(str, strlen(str), "UTF-8", from_codeset, NULL, NULL, NULL, NULL); + ret = g_convert_with_fallback(str, -1, "UTF-8", from_codeset, NULL, NULL, NULL, NULL); - if (ret){ + if (ret) { tmp = ret; ret = sanitize_utf((gchar *)tmp, strlen((gchar *)tmp), &newlen); g_free(tmp);