[Kde-pim] Akonadi encoding woes

Milian Wolff mail at milianw.de
Fri Jul 9 09:31:24 BST 2010


Milian Wolff, 06.07.2010:
> Heyho,
> 
> I've debugged the encoding problems in Akonadi and found that it is mainly
> due to a Qt bug I just reported together with a testcase. Essentially, Qt
> does double encoding on BINARY fields.
> 
> http://bugreports.qt.nokia.com/browse/QTBUG-11963

bug report got closed showing that our code is wrong:

~~
This code works fine:

qDebug() << "this works:" << query.value(0).toString() << "this is broken:" << 
QString::fromUtf8(query.value(1).toByteArray());

Qt mysql driver always uses utf8 mode to connect to the mysql server, so "SET 
NAMES utf8" is not needed, but the returned UTF-8 value is QByteArray, all you 
need to do is convert the byte array into QString again.
~~

So we have to adapt our XSLT to generate that kind of code. This is still 
_much_ better than using LIKE BINARY everywhere.

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100709/2bc7bc88/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list