changeset 9476:4d39f4d1034b

[gaim-migrate @ 10301] This changes Oscar to use g_utf8_validate for UTF-8 validation, rather than attempting a conversion from UTF-8 to UTF-8, as the latter appears to be problematic with some iconvs. This causes Oscar to print a conversion failure message (ala IRC) if we receive non-ASCII marked as such -- I don't think this is a problem, as I believe the ICQ funkiness is marked as ISO-8859-1, but if you get the message let me know. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Wed, 07 Jul 2004 17:56:59 +0000
parents 7a65fdba750f
children 2c7dcb5851f4
files src/protocols/oscar/oscar.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/oscar.c	Wed Jul 07 16:32:05 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Wed Jul 07 17:56:59 2004 +0000
@@ -399,7 +399,10 @@
 
 	switch (flags) {
 	case 0:
-		utf8 = g_convert(text, textlen, "UTF-8", "UTF-8", NULL, NULL, NULL);
+		if (!g_utf8_validate(text, textlen, NULL))
+			utf8 = g_strdup(_("(There was an error converting this message.  The buddy you are speaking to most likely has a buggy client.)"));
+		else
+			utf8 = g_strdup(text);
 		break;
 	case AIM_IMFLAGS_ISO_8859_1:
 		utf8 = g_convert(text, textlen, "UTF-8", "ISO-8859-1", NULL, NULL, NULL);