srhea/scalaqlite — pull request #14 by eatkins (2014-05-14 22:32:56+00:00)
Title: Change SqlText bind method

We discovered recently that Scalaqlite didn't correctly bind UTF-8
strings that contained non-ascii characters, e.g. Chinese characters.
One fix would be to change the line in
Java_org_srhea_scalaqlite_Sqlite3C_bind_1text from

jint len = env->GetStringLength(jvalue);

to

jint len = env->GetStringUTFLength(jvalue);

but, from the documenation, getStringUTFLength returns the length in
bytes of the modified UTF-8 representation of a string. It feels cleaner
to just work directly with the byte array, hence this change.

This is about 5% slower than using java character arrays, but those are
unfortunately serialized as modified-utf8 arrays, so this is safer.