Skip to content

COLLATE unicode_ci #4700

Answered by pawelsalawa
VladimV asked this question in Q&A
Discussion options

You must be logged in to vote

You need to register a default collation comparator to be used if SQLite does not have "unicode_ci" collation registered. This is done with call to sqlite3_collation_needed() -> https://sqlite.org/c3ref/collation_needed.html

A function pointer that you register with this function will be called by SQLite every time a collation is required to compare 2 values, but SQLite is unable to find suitable collation in its registry.

In SQLiteStudio it's done in https://github.com/pawelsalawa/sqlitestudio/tree/master/SQLiteStudio3/coreSQLiteStudio/db)/abstractdb3.h

Firstly, you can find:

int res = T::collation_needed(dbHandle, defaultCollationUserData, &AbstractDb3<T>::registerDefaultCollation);
   …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by VladimV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants