Error in KApplication::invokeMailer(QString...)
Stephan Kulow
coolo at kde.org
Fri Oct 4 10:24:42 BST 2002
On Freitag, 4. Oktober 2002 01:09, Ingo Klöcker wrote:
> Hi,
>
> 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)
> http://bugs.kde.org/show_bug.cgi?id=41018
>
> 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?
Actually 8bit command line arguments are quite broken (#48120) and I'd like to
have it fixed before 3.1, and kmail is most likely only a small part of it :)
But yes, the codec should move to kdelibs as a work around in kmail wouldn't
help if your mailer is xterm -e pine :)
Greetings, Stephan
More information about the kde-core-devel
mailing list