[gmime/gmime-2-4] Don't skip validation of UTF-8 text



commit ebd7526d61e69436c6063ab2ce3c7fa11298b6ea
Author: Jeffrey Stedfast <fejj gnome org>
Date:   Sun Jul 17 17:05:42 2011 -0400

    Don't skip validation of UTF-8 text
    
    2011-07-17  Jeffrey Stedfast  <fejj gnome org>
    
    	* gmime/gmime-utils.c (charset_convert): Don't skip validation
    	* of
    	UTF-8 text.

 ChangeLog           |    5 +++++
 gmime/gmime-utils.c |    8 ++++----
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 12f4c72..8cf6097 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-07-17  Jeffrey Stedfast  <fejj gnome org>
 
+	* gmime/gmime-utils.c (charset_convert): Don't skip validation of
+	UTF-8 text.
+
+2011-07-17  Jeffrey Stedfast  <fejj gnome org>
+
 	* gmime/gmime-utils.c (charset_convert): Handle ERANGE the same as
 	EILSEQ.
 
diff --git a/gmime/gmime-utils.c b/gmime/gmime-utils.c
index 428a284..18c01fb 100644
--- a/gmime/gmime-utils.c
+++ b/gmime/gmime-utils.c
@@ -1818,10 +1818,10 @@ rfc2047_decode_word (const char *in, size_t inlen)
 		p = (char *) decoded;
 		len = declen;
 		
-		//while (!g_utf8_validate (p, len, (const char **) &p)) {
-		//	len = declen - (p - (char *) decoded);
-		//	*p = '?';
-		//}
+		while (!g_utf8_validate (p, len, (const char **) &p)) {
+			len = declen - (p - (char *) decoded);
+			*p = '?';
+		}
 		
 		return g_strndup ((char *) decoded, declen);
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]