Mercurial > pidgin.yaz
diff libpurple/protocols/yahoo/util.c @ 27773:0f3a131d23da
- import nosuke's hash 244 patch and others to yahoo plugin
- do not perform any conversion in sanitize_* if _WIN32 defined
- suppress warning as much as possible
- fix indentation
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 29 Feb 2008 17:56:13 +0000 |
parents | 839cc551cad9 |
children | acef4202e147 |
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/util.c Fri Feb 29 08:32:34 2008 +0000 +++ b/libpurple/protocols/yahoo/util.c Fri Feb 29 17:56:13 2008 +0000 @@ -113,7 +113,7 @@ { struct yahoo_data *yd = gc->proto_data; char *ret = NULL; - size_t newlen; + gsize newlen; const char *to_codeset; if (utf8 && *utf8) { @@ -145,8 +145,8 @@ { struct yahoo_data *yd = gc->proto_data; char *ret, *tmp; - char *from_codeset; - size_t newlen; + const char *from_codeset; + gsize newlen; if (utf8) { ret = sanitize_utf((gchar *)str, strlen((gchar *)str), &newlen); @@ -159,14 +159,7 @@ else from_codeset = purple_account_get_string(purple_connection_get_account(gc), "local_charset", "ISO-8859-1"); - /* yaz: it's a kind of voodoo to avoid malconversion of "~". */ - tmp = g_convert(str, strlen(str), "EUC-JP", from_codeset, NULL, NULL, NULL); - if(tmp) { - ret = g_convert(tmp, strlen(tmp), "UTF-8", "EUC-JP", NULL, NULL, NULL); - g_free(tmp); - } else { - ret = g_convert_with_fallback(str, strlen(str), "UTF-8", from_codeset, NULL, NULL, NULL, NULL); - } + ret = g_convert_with_fallback(str, strlen(str), "UTF-8", from_codeset, NULL, NULL, NULL, NULL); if (ret){ tmp = ret;