Gene Michael Stover
created Sunday, 2025 May 4
original at cybertiggyr.com/iunicode.html
You store your audio & video files in Media Monkey. You're writing your own programs to query the Media Monkey database. You're getting an error that the IUNICODE collation sequence is unknown.
The specific error I saw included
“PHP Warning: SQLite3::query(): Unable to prepare statement: no such collation sequence: IUNICODE
”.
In this file, I show you how to fix it. (It's easy.)
After you open the SQLite3 database, you can register a comparison function for the IUNICODE collation sequence.
SQLite3 provides a sqlite3_create_collation(...)
function to do that.
I was working in PHP, so I did this...
// I've omitted error checks from this example for clarity
$db = new SQLite3($dbname);
$db->createCollation("IUNICODE", "strnatcasecmp");
$rows = $db->query("SELECT DISTINCT Genre FROM Songs");
Without the createCollation(...)
call,
I saw the aforementioned error.
Read about Collating Sequences & the sqlite3_create_collation(...)
function at www.sqlite.org.
If you are working in PHP, read about the SQLite3::createCollation(...) method at php.net.
I tried to do so at 2 sites, but they wanted me to create an account. I have too many accounts & don't want more. I wasn't motivated enough to create a throw-away account nor to try other sites..
when | who | what |
---|---|---|
2025-05-04 | gene | Play. |
Copyright © 2025 Gene Michael Stover. All rights reserved. Permission to copy store, transmit, and view in electronic form is granted. Permission to link to this document is granted.