Unicode, SQLite, and Database Library
Posted: Wed Jun 01, 2011 1:09 am
I am building a front end to a Russian-English dictionary database (SQLite). The data is in Unicode. I've overcome several hurdles of Unicode in LC and have now gotten to the point where my scripts are ready to retrieve the data:
Table RDTKeys has both Russian and English words in column RDTKey. When the word in field SearchTarget is English, locResult returns the expected results, and everything is fine. When it is a Russian word, the records are never found.
The database is in a local file--this is not an online database.
I can browse this database with a SQLite browser, I can retrieve data from it in other applications by doing similar searches, I know the records are there, and I know the Russian in this db is in Unicode.
What am I doing wrong?
How can I get deeper into the bowels of the Database Library to see what's happening?
Has anyone successfully worked in LC with a Unicode, non-English SQLite database?
Thanks, folks,
Slava
Code: Select all
put "SELECT RecNum FROM RDTKeys WHERE (RDTKey = :1)" into locSQLString
put the unicodeText of field "SearchTarget" into locTarget
--field SearchTarget has a Russian or an English word
put uniDecode(locTarget, "UTF16") into locSQLParams --now locSQLParams is UTF-8
get revDataFromQuery(,, gDictDBID, locSQLString, "locSQLParams")
if it is empty then
answer "Not found"
else
answer it
end if
The database is in a local file--this is not an online database.
I can browse this database with a SQLite browser, I can retrieve data from it in other applications by doing similar searches, I know the records are there, and I know the Russian in this db is in Unicode.
What am I doing wrong?
How can I get deeper into the bowels of the Database Library to see what's happening?
Has anyone successfully worked in LC with a Unicode, non-English SQLite database?
Thanks, folks,
Slava