[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/plugins/kmail/bodypartformatter
From:       Martin Koller <m.koller () surfeu ! at>
Date:       2008-02-01 18:59:17
Message-ID: 1201892357.265963.18839.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 769642 by mkoller:

Regard content in UTF-8 not only on display but also when
creating a reply mail, when no charset is given


 M  +10 -1     text_calendar.cpp  


--- trunk/KDE/kdepim/plugins/kmail/bodypartformatter/text_calendar.cpp #769641:769642
@@ -471,7 +471,16 @@
     bool handleClick( KMail::Interface::BodyPart *part,
                       const QString &path, KMail::Callback& c ) const
     {
-      QString iCal = part->asText();
+      QString iCal;
+      /* If the bodypart does not have a charset specified, we need to fall back to
+         utf8, not the KMail fallback encoding, so get the contents as binary and decode
+         explicitely. */
+      if ( part->contentTypeParameter( "charset").isEmpty() ) {
+        const QByteArray &ba = part->asBinary();
+        iCal = QString::fromUtf8(ba);
+      } else {
+        iCal = part->asText();
+      }
       bool result = false;
       if ( path == "accept" )
         result = handleInvitation( iCal, Attendee::Accepted, c );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic