Error in KApplication::invokeMailer(QString...)

Ingo Klöcker kloecker at
Fri Oct 4 00:09:16 BST 2002

Hash: SHA1


while fixing address related bugs in KMail I noticed that the way 
KApplication::invokeMailer(QString...) passes email addresses to the 
email application should be changed. Currently it simply passes email 
addresses as Unicode strings to the email application. This fails since 
somewhere between invokeMailer and KMail the Unicode strings is (most 
likely) converted to latin1. All non-latin1 characters will end up as 
question marks.

This is for example the cause for Bug #41018 (KAddressBook doesn't 
support "send mail" with Cyrillic names correctly)

To reproduce add the address 寿司 刺身 <sushi at sashimi> to your address book 
and try to send a mail. You'll see that the To: field in KMail will be 
filled with ?? ?? <sushi at sashimi>.

According to RFC 2368 (The mailto URL scheme) email addresses have to be 
encoded as described in RFC 2047 if they contain 8-bit characters.

The aforementioned email address encoded according to RFC 2047 looks 
like this: =?utf-8?b?5a+/5Y+4IOWIuui6qw==?= <sushi at sashimi>

When you start KMail with the following command line you will get the 
desired result:
kmail '=?utf-8?b?5a+/5Y+4IOWIuui6qw==?= <sushi at sashimi>'

This means that in KApplication::invokeMailer() the following strings 
have to be encoded according to RFC 2047 before they are passed to the 
email application: to, cc, bcc, subject
The body of the message must not be encoded.

The problem is that AFAICS the RFC 2047 codec currently only exists in 
KMail (KMMsgBase::encodeRFC2047String(...) and 
KMMsgBase::decodeRFC2047String(...) ).

How should we proceed? Should these two functions be moved to KCodecs? 
Should this happen before or after KDE 3.1?


Version: GnuPG v1.2.0 (GNU/Linux)


More information about the kde-core-devel mailing list