From 4286a80d9dc003be9fd5071565e6252cbbad4452 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sun, 19 Jun 2011 18:16:49 +0000 Subject: [PATCH] Alias for UTF-7 charset. --- src/charset.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/charset.cpp b/src/charset.cpp index e0431860..0fda4506 100644 --- a/src/charset.cpp +++ b/src/charset.cpp @@ -45,6 +45,9 @@ charset::charset() 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"; } @@ -60,6 +63,10 @@ void charset::parse(const string& buffer, const string::size_type position, m_name = utility::stringUtils::trim (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)