diff libpurple/protocols/oscar/oscar.c @ 27788:9cd7baa0627e

propagate from branch 'im.pidgin.pidgin' (head 6e57c4c3ef7f3cc9df8b67e8897a30bbe0405817) to branch 'im.pidgin.pidgin.yaz' (head 490506ec23af59278efb862e28035688b8bbadf1)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 08 Mar 2008 14:22:30 +0000
parents f2167b8f91ef 7b4d39ffd563
children 9f67f9a58564
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Thu Mar 06 15:43:12 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Sat Mar 08 14:22:30 2008 +0000
@@ -245,7 +245,7 @@
 	}
 
 	/*
-	 * Must we send this message as UNICODE (in the UCS-2BE encoding)?
+	 * Must we send this message as UNICODE (in the UTF-16BE encoding)?
 	 */
 	while (utf8[i])
 	{
@@ -332,15 +332,15 @@
 	} else if (!g_ascii_strcasecmp(encoding, "unicode-2-0")) {
 		/* Some official ICQ clients are apparently total crack,
 		 * and have been known to save a UTF-8 string converted
-		 * from the locale character set to UCS-2 (not from UTF-8
-		 * to UCS-2!) in the away message.  This hack should find
+		 * from the locale character set to UTF-16 (not from UTF-8
+		 * to UTF-16!) in the away message.  This hack should find
 		 * and do something (un)reasonable with that, and not
 		 * mess up too much else. */
 		const gchar *charset = purple_account_get_string(account, "encoding", NULL);
 		sanitize_ucs((gchar *)text, textlen);
 		if (charset) {
 			gsize len;
-			utf8 = g_convert(text, textlen, charset, "UCS-2BE", &len, NULL, NULL);
+			utf8 = g_convert(text, textlen, charset, "UTF-16BE", &len, NULL, NULL);
 			if (!utf8 || len != textlen || !g_utf8_validate(utf8, -1, NULL)) {
 				g_free(utf8);
 				utf8 = NULL;
@@ -349,7 +349,7 @@
 			}
 		}
 		if (!utf8)
-			utf8 = g_convert(text, textlen, "UTF-8", "UCS-2BE", NULL, NULL, NULL);
+			utf8 = g_convert(text, textlen, "UTF-8", "UTF-16BE", NULL, NULL, NULL);
 	} else if (g_ascii_strcasecmp(encoding, "utf-8")) {
 		purple_debug_warning("oscar", "Unrecognized character encoding \"%s\", "
 						   "attempting to convert to UTF-8 anyway\n", encoding);
@@ -442,7 +442,7 @@
 		return NULL;
 
 	if (charset == AIM_CHARSET_UNICODE) {
-		charsetstr1 = "UCS-2BE";
+		charsetstr1 = "UTF-16BE";
 		charsetstr2 = "UTF-8";
 	} else if (charset == AIM_CHARSET_CUSTOM) {
 		if ((sourcesn != NULL) && aim_snvalid_icq(sourcesn))
@@ -514,7 +514,7 @@
 	 * If we're sending to an ICQ user, and they are in our
 	 * buddy list, and they are advertising the Unicode
 	 * capability, and they are online, then attempt to send
-	 * as UCS-2BE.
+	 * as UTF-16BE.
 	 */
 	if ((destsn != NULL) && aim_snvalid_icq(destsn))
 		userinfo = aim_locate_finduserinfo(od, destsn);
@@ -525,7 +525,7 @@
 		b = purple_find_buddy(account, destsn);
 		if ((b != NULL) && (PURPLE_BUDDY_IS_ONLINE(b)))
 		{
-			*msg = g_convert(from, strlen(from), "UCS-2BE", "UTF-8", NULL, &msglen, NULL);
+			*msg = g_convert(from, strlen(from), "UTF-16BE", "UTF-8", NULL, &msglen, NULL);
 			botch_ucs(*msg, msglen);
 			if (*msg != NULL)
 			{
@@ -558,9 +558,9 @@
 	}
 
 	/*
-	 * Nothing else worked, so send as UCS-2BE.
+	 * Nothing else worked, so send as UTF-16BE.
 	 */
-	*msg = g_convert(from, strlen(from), "UCS-2BE", "UTF-8", NULL, &msglen, &err);
+	*msg = g_convert(from, strlen(from), "UTF-16BE", "UTF-8", NULL, &msglen, &err);
 	botch_ucs(*msg, msglen);
 	if (*msg != NULL) {
 		*charset = AIM_CHARSET_UNICODE;
@@ -4462,7 +4462,7 @@
 
 	charset = oscar_charset_check(str);
 	if (charset == AIM_CHARSET_UNICODE) {
-		encoded = g_convert(str, strlen(str), "UCS-2BE", "UTF-8", NULL, ret_len, NULL);
+		encoded = g_convert(str, strlen(str), "UTF-16BE", "UTF-8", NULL, ret_len, NULL);
 		botch_ucs(encoded, *ret_len);
 		*encoding = "unicode-2-0";
 	} else if (charset == AIM_CHARSET_CUSTOM) {