Update of /cvsroot/mahogany/M/src/mail
In directory usw-pr-cvs1:/tmp/cvs-serv20437/src/mail
Modified Files:
MailFolderCC.cpp
Log Message:
decode (wrongly) double RFC 2047 encoded headers
Index: MailFolderCC.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/mail/MailFolderCC.cpp,v
retrieving revision 1.605
retrieving revision 1.606
diff -b -u -2 -r1.605 -r1.606
--- MailFolderCC.cpp 22 Apr 2002 10:12:06 -0000 1.605
+++ MailFolderCC.cpp 24 Apr 2002 17:46:37 -0000 1.606
@@ -1358,7 +1358,6 @@
charset encoding for us and also QP/Base64 encoding for RFC 2047
*/
-
-/* static */
-String MailFolder::DecodeHeader(const String &in, wxFontEncoding *pEncoding)
+static
+String DecodeHeaderOnce(const String& in, wxFontEncoding *pEncoding)
{
// we don't enforce the sanity checks on charset and encoding - should we?
@@ -1510,4 +1509,23 @@
return out;
+}
+
+/* static */
+String MailFolder::DecodeHeader(const String& in, wxFontEncoding *pEncoding)
+{
+ // some brain dead mailer encode the already encoded headers so to obtain
+ // the real header we keep decoding it until it stabilizes
+ String header,
+ headerOrig = in;
+ for ( ;; )
+ {
+ header = DecodeHeaderOnce(headerOrig, pEncoding);
+ if ( header == headerOrig )
+ break;
+
+ headerOrig = header;
+ }
+
+ return header;
}
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates