Adding ICU (Unicode) support to Xojo's SQLite database

I’ve written an article and a ready-to-use project on how to add full unicode support to the REALSQLDatabase and SQLiteDatabase classes.

See here: http://blog.tempel.org/2015/09/xojosqliteextensions.html

Hope it helps some people.

Read your article… but now I’m confused…
OSX has SQLite installed.
XOJO uses SQLite
XCODE ObjC (and Swift if you know how to do it) uses SQLite

But your article seemed to infer that XOJO does NOT use the same LIBSQLITE3.DYLIB file the other two use?
If that is true, why is it that way?
If it is not true, then the OS X default dylib doesn’t have ICU either?

The sqlite plugin in Xojo does NOT use the system library
Sqlite is statically linked right into the plugin

So regardless of what OS version you’re using you have the same sqlite version
If you use the system dylib then on OS X 10.7 you get one version, 10.8 another, 10.9 another, etc
Or you build one version & distribute it consistently & you have the same effect as the Sqlite plugin - a consistent version

I’ve not checked the system’s dylib but OS X’s sqlite3 command doesn’t seem to include ICU statically and neither allows me to load the extension. Which sucks. May be there’s another way to enable unicode handling, but I don’t know about.

Here’s the test I used to determine ICU support:

SELECT upper('ä');

should return Ä if it has full unicode support.

(BTW, to confirm this, as I’m not 100% sure, I’ve asked on SO)

Does Valentina’s implementation of SQLite have full unicode support?

Well, you can use the icu enabled sqlite3 dylib with MBS SQL Plugin to do this, too.

But strange that in all the years nobody asked for it?

Does anyone know where to get a version of libsqlite3.dylib that has the encryption codec activated?
and can be used with a non-XOJO iOS project?
AND that will be accepted by APPLE (they have rejected apps that INCLUDE the dylib instead of linking to it)

I have an SQL wrapper, but KEY and REKEY don’t seem to be implemented in the dylib

You wont (or shouldn’t) find a version of libsqlite3 that has Dr Hipps encryption in it since the license you sign a) costs $2000 and b) gives you no right to redistribute it that way

I’ve seen that… which is ludicrous… $2000 to add encryption to a “free” database engine?
I understand that $2k is nothing towards product development for XOJO etc… but it also surprise me that the SQLite lib in iOS does not have that compiled into it already… I mean… $2k is even less to Apple :slight_smile:

So I am trying to figure my options

He should charge for SQLite itself as well IMHO

There are free options for encryption BUT they are incompatible with each other and with the encryption from Dr Hipp