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

List:       kde-pim
Subject:    Re: [Kde-pim] Character encoding handling in KMail/KMime
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2011-11-28 21:06:24
Message-ID: 201111282206.24897 () thufir ! ingo-kloecker ! de
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Monday 28 November 2011, Andras Mantia wrote:
> Hi,
> 
>  on the weekend I fixed a problem introduced with the HTML reply
> branch, where the characters in the reply were wrongly encoded.
> While trying to get around the code and see where do the strings get
> broken I realized that it is just insane what we do there with the
> character encodings. The messages are encoded, decoded often (and
> now I refer both to charset encoding and string encoding for
> transfer), while the message does not leave KMail (or its libraries,
> like composer, templateparser) code. This also includes of course a
> lot of QString->QByteArray and QByteArray->QString covnersion. In my
> opinion there should be exactly two conversion: when the message is
> read into KMime and when it is written out from KMime (either to
> disc, send through the network or someway else). For all the rest it
> should be just unicode in a QString.
>  Of course this is an intrusive change and KDE 5 (or whatever comes
> next material). What do you think of it? Does it even makes sense to
> go in this direction? Any better ideas?

This is difficult to answer because it depends on what the 
representation of the message is used for. Of course, it makes sense to 
reduce the conversions as much as possible, but I don't think that using 
a Unicode representation of the whole message makes sense. Do you mean 
the message text?

Actually, I think the message as a whole should never be serialized as 
Unicode string because it is never needed in this form. (Correct me if 
I'm wrong.) The message should either be in KMime or it should be 
serialized into a QByteArray (for storage on disk and sending). Apart 
from this only the body and the header content of individual message 
parts should be converted to Unicode for display, composing and other 
tasks where Unicode is really needed.


Regards,
Ingo

["signature.asc" (application/pgp-signature)]

_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

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

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