# HG changeset patch # User Mark Doliner # Date 1165815319 0 # Node ID b7f83eba60294530cb4d4fd897127046b2148db4 # Parent 8bc3947970966b2a9c9ddabd636b193ac6aefa85 [gaim-migrate @ 17956] Apparently when Win AIM 6.0 sees "us-ascii" it parses the incoming message as Windows CP-1252. We might as well do the same thing, since there isn't any particular reason for us to parse us-ascii as UTF-8. committer: Tailor Script diff -r 8bc394797096 -r b7f83eba6029 libgaim/protocols/oscar/oscar.c --- a/libgaim/protocols/oscar/oscar.c Mon Dec 11 05:29:50 2006 +0000 +++ b/libgaim/protocols/oscar/oscar.c Mon Dec 11 05:35:19 2006 +0000 @@ -303,18 +303,20 @@ gaim_debug_info("oscar", "Empty encoding, assuming UTF-8\n"); } else if (!strcasecmp(encoding, "iso-8859-1")) { utf8 = g_convert(text, textlen, "UTF-8", "iso-8859-1", NULL, NULL, NULL); - } else if (!strcasecmp(encoding, "ISO-8859-1-Windows-3.1-Latin-1")) { + } else if (!strcasecmp(encoding, "ISO-8859-1-Windows-3.1-Latin-1") || + !strcasecmp(encoding, "us-ascii")) + { utf8 = g_convert(text, textlen, "UTF-8", "Windows-1252", NULL, NULL, NULL); } else if (!strcasecmp(encoding, "unicode-2-0")) { utf8 = g_convert(text, textlen, "UTF-8", "UCS-2BE", NULL, NULL, NULL); - } else if (strcasecmp(encoding, "us-ascii") && strcmp(encoding, "utf-8")) { + } else if (strcasecmp(encoding, "utf-8")) { gaim_debug_warning("oscar", "Unrecognized character encoding \"%s\", " "attempting to convert to UTF-8 anyway\n", encoding); utf8 = g_convert(text, textlen, "UTF-8", encoding, NULL, NULL, NULL); } /* - * If utf8 is still NULL then either the encoding is us-ascii/utf-8 or + * If utf8 is still NULL then either the encoding is utf-8 or * we have been unable to convert the text to utf-8 from the encoding * that was specified. So we check if the text is valid utf-8 then * just copy it.