[Kde-pim] akonadi, server/storage and PostgreSQl

Kevin Krammer krammer at kde.org
Thu Sep 12 11:33:46 BST 2013


On Thursday, 2013-09-12, Cédric Villemain wrote:
> Le jeudi 12 septembre 2013 11:48:47 Kevin Krammer a écrit :
> > On Thursday, 2013-09-12, Cédric Villemain wrote:
> > > > > Akonadi maps QString to BYTEA (PostgreSQL data type), I believe
> > > > > it
> > > > > should map it to TEXT. 1. we do use toLatin1 to prepare data
> > > > > when
> > > > > working with QString, so it should be safe for TEXT in
> > > > > PostgreSQL.
> > > > > 2. escaping BYTEA and TEXT does not work the same, BYTEA are
> > > > > escaped string *or* hex string. TEXT is plain, or escaped.
> > > > 
> > > > We would need to check what kind of data is stored in BYTEA, but
> > > > QString itself is UTF8. Does TEXT support utf8 (sorry, no time to
> > > > look this up now)?
> > > 
> > > Yes, it does.
> > 
> > Just for the record: QString uses a 16bit encoding interally (UTF_16 I
> > think) but it can convert from/to UTF-8.
> 
> important record!
> How does it works for UTF16 users currently, Is akonadi UTF16
> compliant ?

You mean the protocol? I am pretty sure it is a 8 bit text data stream so all 
QStrings will be converted from/to UTF-8

> I've seen some .toLatin1() (LATIN1 is also an encoding supported by
> PostgreSQL) so I supposed that the strings are all converted to latin1
> (in akonadi). However, there are also some conversion to UTF8...

Latin1 is not likely good enough, it can only encode a subset of the 
characters that a QString can hold.
It migh be used in contexts when then QString is known to only contain latin1 
compatible data.
Things like a collection name can contain non-latin1 characters.

Cheers,
Kevin

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20130912/20e23536/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