2004-10-30 Mikael Hallendal <micke@imendio.com>
authorhallski <hallski>
Fri, 29 Oct 2004 22:48:03 +0000
changeset 102 f47119027379
parent 101 a8abfbc8c005
child 103 a0341fcc670d
2004-10-30 Mikael Hallendal <micke@imendio.com> * loudmouth/lm-parser.c: (lm_parser_parse): - Removed that hack to try to convert to utf8, the stream should be utf8 according to the Jabber specs. This hack caused a lot of weird problems. - Solves bug #154228
ChangeLog
loudmouth/lm-parser.c
--- a/ChangeLog	Thu Oct 21 23:18:51 2004 +0000
+++ b/ChangeLog	Fri Oct 29 22:48:03 2004 +0000
@@ -1,3 +1,11 @@
+2004-10-30  Mikael Hallendal  <micke@imendio.com>
+
+	* loudmouth/lm-parser.c: (lm_parser_parse):
+        - Removed that hack to try to convert to utf8, the stream should be 
+          utf8 according to the Jabber specs. This hack caused a lot of weird
+          problems.
+        - Solves bug #154228
+
 2004-10-22  Mikael Hallendal  <micke@imendio.com>
 
 	reviewed by: <delete if not using a buddy>
--- a/loudmouth/lm-parser.c	Thu Oct 21 23:18:51 2004 +0000
+++ b/loudmouth/lm-parser.c	Fri Oct 29 22:48:03 2004 +0000
@@ -246,40 +246,16 @@
 {
 	g_return_if_fail (parser != NULL);
 	
-	if (!parser->context) {
-		parser->context = g_markup_parse_context_new (parser->m_parser, 0,
-							      parser, NULL);
-	}
-
-	if (!g_utf8_validate (string, -1, NULL)) {
-		gchar *tmp;
-		
-		/* We can't do much better than guess what charset the string is
-		 * encoded in... Try ISO-8859-1.
-		 */
-		tmp = g_convert (string, -1,
-				 "UTF-8", "ISO-8859-1",
-				 NULL, NULL,
-				 NULL);
-		
-		if (tmp) {
-			if (g_markup_parse_context_parse (parser->context, tmp, 
-							  strlen (tmp), NULL)) {
-			} else {
-				g_warning ("Parsing failed\n");
-			}
-			
-			g_free (tmp);
-		} else {
-			g_warning ("Trying to parse a string that is not UTF-8 and not ISO-8859-1.");
-		}
-	} else {
-		if (g_markup_parse_context_parse (parser->context, string, 
-						  strlen (string), NULL)) {
-		} else {
-			g_warning ("Parsing failed\n");
-		}
-	}
+        if (!parser->context) {
+                parser->context = g_markup_parse_context_new (parser->m_parser, 0,
+                                                              parser, NULL);
+        }
+        
+        if (g_markup_parse_context_parse (parser->context, string, 
+                                          strlen (string), NULL)) {
+        } else {
+                g_warning ("Parsing failed\n");
+        }
 }
 
 void