diff libpurple/protocols/oscar/encoding.c @ 30827:ed520e6e972b

Renames and cleanups.
author ivan.komarov@soc.pidgin.im
date Sat, 31 Jul 2010 20:00:39 +0000
parents a4f579485ce6
children 1f3ef11a9690
line wrap: on
line diff
--- a/libpurple/protocols/oscar/encoding.c	Wed Jul 28 23:53:25 2010 +0000
+++ b/libpurple/protocols/oscar/encoding.c	Sat Jul 31 20:00:39 2010 +0000
@@ -20,19 +20,6 @@
 
 #include "encoding.h"
 
-guint16
-oscar_charset_check(const char *utf8)
-{
-	while (*utf8++)
-	{
-		if ((unsigned char)(*utf8) > 0x7f) {
-			/* not ASCII! */
-			return AIM_CHARSET_UNICODE;
-		}
-	}
-	return AIM_CHARSET_ASCII;
-}
-
 static gchar *
 encoding_extract(const char *encoding)
 {
@@ -214,10 +201,23 @@
 	return ret;
 }
 
+static guint16
+get_simplest_charset(const char *utf8)
+{
+	while (*utf8++)
+	{
+		if ((unsigned char)(*utf8) > 0x7f) {
+			/* not ASCII! */
+			return AIM_CHARSET_UNICODE;
+		}
+	}
+	return AIM_CHARSET_ASCII;
+}
+
 gchar *
-oscar_convert_to_best_encoding(const gchar *msg, gsize *result_len, guint16 *charset, gchar **charsetstr)
+oscar_encode_im(const gchar *msg, gsize *result_len, guint16 *charset, gchar **charsetstr)
 {
-	guint16 msg_charset = oscar_charset_check(msg);
+	guint16 msg_charset = get_simplest_charset(msg);
 	if (charset != NULL) {
 		*charset = msg_charset;
 	}