Bug in MySQL code?

Lars Skjærlund las at dbc.dk
Tue Nov 17 14:56:27 UTC 2015


Hi,

I'm afraid I've hit a bug:

I want to migrate our Kallithea database from SQLite to MySQL. In order to do that, I dumped the SQLite database to an SQL script, modified the SQL commands to MySQL dialect, and ran the script against the MySQL database.

It worked like a charm - except that Kallithea kept crashing with Unicode errors.

But everything _was_ Unicode: The dump from SQLite was Unicode, my edits where fully Unicode compatible, and the database as well as the tables where created in MySQL as UTF8 compatible. After fighting this for a long time, I tried letting Kallithea populate a new MySQL database - and discovered that Kallithea doesn't store data in UTF8 format. It appears that the data is encoded for UTF8 twice, so my record looks like

+-----------+--------------+
| firstname | lastname     |
+-----------+--------------+
| Lars      | Skjærlund   |
+-----------+--------------+

If update my name to be true UTF8, Kallithea crashes. I haven't tried other databases, but the encoding in SQLite is correct.

I solved my problem by running the SQL scriptfile through iconv before submitting it to MySQL, claiming the input was Latin1 and asking for UTF8 as output: In that way I got the same double-encoding that Kallithea appears to require...


[mail_logo]<http://www.dbc.dk/>

Med venlig hilsen
Lars Skjærlund
DevOps
Tlf.: 44 86 77 77
DBC as

www.dbc.dk<http://www.dbc.dk/>
las at dbc.dk<mailto:las at dbc.dk>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20151117/1bfb8085/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 2907 bytes
Desc: image001.png
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20151117/1bfb8085/attachment.png>


More information about the kallithea-general mailing list