UNICODE Collate?

45 views
Skip to first unread message

Grunthos

unread,
Mar 26, 2012, 6:45:41 PM3/26/12
to sqlite4java

I don't suppose there is any chance to add Case-insensitive UNICODE
support in the library? My understanding is that SQLite does not
implement unicode because it is (a) large and (b) implemented on each
platform, so their view is 'just add your own collation'.
Unfortunately, in Java that it not so easy.

A solution that just worked out of the box (a little like Android
"Collate UNICODE" ... except they broke it in ICS) would be great.


Igor Sereda

unread,
Mar 29, 2012, 4:46:08 PM3/29/12
to sqlite4java
Grunthos, that's a good question.

We could possibly address that by implementing
sqlite3_create_collation and passing the strings to Java for
comparison. But that would utterly kill sorting performance due to JNI
passthru and garbage required for every comparison.

I think the best bet would be to store a lowercase version of a text
column and use it for sorting - if you have column NAME, add column
NAME_LOWER. Extra space cost, extra work on the Java side to maintain
the invariant between the two columns, but it could be done right
away.

Hope this helps.
Igor
Reply all
Reply to author
Forward
0 new messages