changeset 14347:a8140cbe08ce

[gaim-migrate @ 17049] Convert the font name to UTF-8 when receiving a message. This should fix a bug where users couldn't receive certain IMs in Adium. committer: Tailor Script <tailor@pidgin.im>
author Mark Huetsch <markhuetsch>
date Sat, 26 Aug 2006 17:28:30 +0000
parents fd744ac11331
children 80b05108652c
files libgaim/protocols/qq/char_conv.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/protocols/qq/char_conv.c	Sat Aug 26 17:24:10 2006 +0000
+++ b/libgaim/protocols/qq/char_conv.c	Sat Aug 26 17:28:30 2006 +0000
@@ -136,14 +136,14 @@
 	return len + 1;
 }
 
-/* convert QQ formatted msg to GAIM formatted msg (and UTF-8) */
+/* convert QQ formatted msg to Gaim formatted msg (and UTF-8) */
 gchar *qq_encode_to_gaim(guint8 *data, gint len, const gchar *msg)
 {
 	GString *encoded;
 	guint8 font_attr, font_size, color[3], bar, *cursor;
 	gboolean is_bold, is_italic, is_underline;
 	guint16 charset_code;
-	gchar *font_name, *color_code, *msg_utf8, *ret;
+	gchar *font_name, *color_code, *msg_utf8, *tmp, *ret;
 
 	cursor = data;
 	_qq_show_packet("QQ_MESG recv for font style", data, len);
@@ -155,7 +155,9 @@
 	read_packet_b(data, &cursor, len, &bar);	/* skip, not sure of its use */
 	read_packet_w(data, &cursor, len, &charset_code);
 
-	font_name = g_strndup((gchar *) cursor, data + len - cursor);
+	tmp = g_strndup((gchar *) cursor, data + len - cursor);
+	font_name = qq_to_utf8(tmp, QQ_CHARSET_DEFAULT);
+	g_free(tmp);
 
 	font_size = _get_size(font_attr);
 	is_bold = _check_bold(font_attr);