Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > e548512dcc847653815f1b7adc710b15 > files > 35

libvmime07-0.7.1-4.fc13.src.rpm

Patch by Zarafa <http://www.zarafa.com/> - some mails have a special definition of the utf-7 character
set, named unicode-1-1-utf-7. Since this name is not defined by iconv, we rename it to utf-7. This name
seems to come from RFC 1642 <http://www.faqs.org/rfcs/rfc1642.html>.

--- libvmime-0.7.1/src/charset.cpp					2005-03-18 22:26:46.000000000 +0100
+++ libvmime-0.7.1/src/charset.cpp.unicode-1-1-utf-7-charset		2007-04-23 17:08:46.714435000 +0200
@@ -64,6 +64,9 @@
 charset::charset(const string& name)
 	: m_name(name)
 {
+	// if we receive this rfc-1642 valid MIME charset, convert it to something usefull for iconv
+	if (utility::stringUtils::isStringEqualNoCase(m_name, "unicode-1-1-utf-7"))
+		m_name = "utf-7";
 }
 
 
@@ -72,6 +75,10 @@
 {
 	m_name = string(buffer.begin() + position, buffer.begin() + end);
 
+	// if we parsed this rfc-1642 valid MIME charset, convert it to something usefull for iconv
+	if (utility::stringUtils::isStringEqualNoCase(m_name, "unicode-1-1-utf-7"))
+		m_name = "utf-7";
+
 	setParsedBounds(position, end);
 
 	if (newPosition)