# HG changeset patch # User Yoshiki Yazawa # Date 1213173567 0 # Node ID 389b22a4431c9a1b2c69c0afc1dd6cfb6d2b5994 # Parent 6e468ac26aac731c6a0ccc4e8fd76e87f3fdeb41 try to fix that the status message appears in wrong encoding when it comes back from auto-away status. diff -r 6e468ac26aac -r 389b22a4431c libpurple/protocols/yahoo/util.c --- a/libpurple/protocols/yahoo/util.c Wed Jun 11 03:46:30 2008 +0000 +++ b/libpurple/protocols/yahoo/util.c Wed Jun 11 08:39:27 2008 +0000 @@ -116,14 +116,12 @@ 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); - - ret = g_convert_with_fallback(str, -1, to_codeset, "UTF-8", "?", NULL, NULL, NULL); if (ret) return ret; else @@ -145,16 +143,13 @@ const char *from_codeset; gsize newlen; - if (utf8) { + if (yd->jp || utf8) { ret = sanitize_utf((gchar *)str, strlen((gchar *)str), &newlen); if (g_utf8_validate(ret, -1, NULL)) return ret; } - if (yd->jp && !utf8) - from_codeset = "SHIFT_JIS"; - else - from_codeset = purple_account_get_string(purple_connection_get_account(gc), "local_charset", "ISO-8859-1"); + 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);