I am planning to write an iOS app which uses SQLite as the backend. My database contains Vietnamese text such as "Hải Sơn". The users, being used to Google search, want to enter a search term like "hai son" in order to find the text above. I tried the following query:
SELECT * FROM towns WHERE title LIKE '%hai son%';
And I got 0 record. How do I make this to work? I know that Google and other search engines handle this case, so it can be done. I also don't want to make my users type the Vietnamese text with complete diacritical marks because not all the users know how to do so.
Update
I looked at the sqlite3 documentation and looks like there are only three valid collation sequences: BINARY, NOCASE, and RTRIM. Am I missing something?.
More info
My table was created with:
CREATE TABLE towns ( sid INTEGER PRIMARY KEY NOT NULL, title TEXT )
So far, I only used the sqlite3 command line to create the database, table, and import text from a CSV file.
My sqlite3 is at version 3.7.12
Update 2
Alias gave me an idea: to create my own collating sequence. I will post a follow up if it works.