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

List:       kde-commits
Subject:    KDE/kdelibs/kdecore/kernel
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2010-07-06 10:32:09
Message-ID: 20100706103209.C3369AC85D () svn ! kde ! org
[Download RAW message or body]

SVN commit 1146666 by tokoe:

Do not use a semi-right RFC2047 encoding here but UTF8+percent-encoding
to pass email addresses with non-latin1 chars to KMail.



 M  +6 -1      ktoolinvocation.cpp  
 M  +16 -5     ktoolinvocation_x11.cpp  


--- trunk/KDE/kdelibs/kdecore/kernel/ktoolinvocation.cpp #1146665:1146666
@@ -327,7 +327,12 @@
     if (!isMainThreadActive())
         return;
 
-    QString address = KUrl::fromPercentEncoding(mailtoURL.path().toLatin1()), subject, cc, bcc, body;
+    QString address = mailtoURL.path();
+    QString subject;
+    QString cc;
+    QString bcc;
+    QString body;
+
     const QStringList queries = mailtoURL.query().mid(1).split( '&');
     QStringList attachURLs;
     for (QStringList::ConstIterator it = queries.begin(); it != queries.end(); ++it)
--- trunk/KDE/kdelibs/kdecore/kernel/ktoolinvocation_x11.cpp #1146665:1146666
@@ -143,14 +143,25 @@
         command = QLatin1String("kmail --composer -s %s -c %c -b %b --body %B --attach %A -- %t");
         if ( !_to.isEmpty() )
         {
-            // put the whole address lists into RFC2047 encoded blobs; technically
-            // this isn't correct, but KMail understands it nonetheless
-            to = QString( "=?utf8?b?%1?=" ).arg( _to.toUtf8().toBase64().constData() );
+            KUrl url;
+            url.setProtocol(QLatin1String("mailto"));
+            url.setPath(_to);
+            to = url.toEncoded();
         }
         if ( !_cc.isEmpty() )
-            cc = QString( "=?utf8?b?%1?=" ).arg( _cc.toUtf8().toBase64().constData() );
+        {
+            KUrl url;
+            url.setProtocol(QLatin1String("mailto"));
+            url.setPath(_cc);
+            cc = url.toEncoded();
+        }
         if ( !_bcc.isEmpty() )
-            bcc = QString( "=?utf8?b?%1?=" ).arg( _bcc.toUtf8().toBase64().constData() );
+        {
+            KUrl url;
+            url.setProtocol(QLatin1String("mailto"));
+            url.setPath(_bcc);
+            bcc = url.toEncoded();
+        }
     } else {
         to = _to;
         cc = _cc;
[prev in list] [next in list] [prev in thread] [next in thread] 

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