diff libpurple/protocols/oscar/encoding.c @ 30834:a6511abec788

A couple of refactorings related to oscar_utf8_try_convert().
author ivan.komarov@soc.pidgin.im
date Thu, 05 Aug 2010 23:43:24 +0000
parents 1f3ef11a9690
children 2eacc8595967 a2e2d351f6fb
line wrap: on
line diff
--- a/libpurple/protocols/oscar/encoding.c	Thu Aug 05 22:57:01 2010 +0000
+++ b/libpurple/protocols/oscar/encoding.c	Thu Aug 05 23:43:24 2010 +0000
@@ -92,6 +92,12 @@
 	const char *charset = NULL;
 	char *ret = NULL;
 
+	if (msg == NULL)
+		return NULL;
+
+	if (g_utf8_validate(msg, -1, NULL))
+		return g_strdup(msg);
+
 	if (od->icq)
 		charset = purple_account_get_string(account, "encoding", NULL);