SF.net SVN: mahogany: [7332] trunk/M/src/classes/MessageView.cpp

[email protected] Wed, 22 Aug 2007 14:03:55 -0700
Newsgroups gmane.mail.mahogany.cvs
Message-ID <[email protected]>
Revision: 7332
          http://mahogany.svn.sourceforge.net/mahogany/?rev=7332&view=rev
Author:   vadz
Date:     2007-08-22 14:03:54 -0700 (Wed, 22 Aug 2007)

Log Message:
-----------
use the MIME part charset for InsertRawContents() argument: this fixes display of HTML messages in Unicode build

Modified Paths:
--------------
    trunk/M/src/classes/MessageView.cpp

Modified: trunk/M/src/classes/MessageView.cpp
===================================================================
--- trunk/M/src/classes/MessageView.cpp	2007-08-21 21:37:58 UTC (rev 7331)
+++ trunk/M/src/classes/MessageView.cpp	2007-08-22 21:03:54 UTC (rev 7332)
@@ -1996,7 +1996,18 @@
          }
          else
          {
-            m_viewer->InsertRawContents(wxString::From8BitData(data, len));
+            wxString s;
+#if wxUSE_UNICODE
+            if ( mimepart->GetType().IsText() )
+            {
+               s = wxCSConv(mimepart->GetTextEncoding()).cMB2WC(data, len, NULL);
+            }
+
+            if ( s.empty() )
+#endif // wxUSE_UNICODE
+               s = wxString::From8BitData(data, len);
+
+            m_viewer->InsertRawContents(s);
          }
       }
       //else: skip this part


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/