changeset 15171:b7f83eba6029

[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 <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 11 Dec 2006 05:35:19 +0000
parents 8bc394797096
children a00712d0522e
files libgaim/protocols/oscar/oscar.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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.