sqlite3_unicode updated for SQLite3 v3.6.7
Since v3.6.1, SQLite3 amalgamation package includes the ICU (International Components for Unicode) source code to make it easier to build SDLite3 with the ICU extension enabled, see [check-in].
This change has broken sqlite3_unicode source code and could no longer be automatically loaded by hijacking the ICU start-up function. For this reason sqlite3_unicode has been updated (to build 10) which is fully compatible with SQLite v3.6.7, but must be manually loaded using custom exported functions, which are defined in a separate sqlite3_unicode.h header file, and explained below.
This version has been tested to build under Microsoft Windows and Ubuntu 8.10 Intrepid and work flawlessly either as a static or shared library.
A bug was fixed in the NOCASE collation source that prevented proper sorting of UTF-8 encoded strings.
NOCASE collation now works for both UTF-8 and UTF-16 encoded strings, but unlike ICU it does not take into account any language specific sorting logarithms.
To activate unicode functionality the following function must be called during application initialization sequence: sqlite3_unicode_load();
The function does not take any arguments and simply calls sqlite3_auto_extension(); function to load the extension.
Similarly before application exit the following function must be called to cleanup memory and unload extension: sqlite3_unicode_free();
The function does not take any arguments and simply calls sqlite3_reset_auto_extension(); function to unload the extension.
The library has been thouroughly tested for Greek language through a small greek-english dictionary project, designed to test:
- the case folding conversion,
- the LIKE operation in a SELECT statement, and
- the NOCASE collation (using case folding and unaccenting of greek strings to enable proper sorting).
Download the implementation file
sqlite3_unicode.c