[Kde-pim] Akonadi encoding woes
Milian Wolff
mail at milianw.de
Tue Jul 6 10:04:07 BST 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
Ok, now what the hell are BINARY fields and why do we need them? Well, mysql is
"wonderful":
mysql> select 'ä' = 'a', 'Ä ' = 'a';
+------------+-------------+
| 'ä' = 'a' | 'Ä ' = 'a' |
+------------+-------------+
| 1 | 1 |
+------------+-------------+
Coming up with even stranger examples is left as an exercise for the bored
reader.
Anyhow, this is the "equals" operator on non-binary fields. If you would select
and compare against a field marked binary, you'd have expected behavior. But
well, binary fields show the double encoding. What to do? I just found the
'LIKE BINARY' operator:
mysql> select 'ä' LIKE BINARY 'a', 'Ä ' LIKE BINARY 'a';
+----------------------+-----------------------+
| 'ä' LIKE BINARY 'a' | 'Ä ' LIKE BINARY 'a' |
+----------------------+-----------------------+
| 0 | 0 |
+----------------------+-----------------------+
Thankfully Akonadi uses a QueryBuilder, so either me or volker will "fix" ==
workaround this awful behavior by doing two things:
- remove all BINARY marks from fields in the table schema
- make the QueryBuilder replace LIKE and = with LIKE BINARY for mysql.
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/20100706/47a9c835/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