Unicode and revDatabase Library, SQLite

Slava Paperno slava at lexiconbridge.com
Tue May 31 20:04:43 EDT 2011


Hello Listers! It's that teacher of Russian again, with another Unicode
hurdle. I knew it wouldn't be long...

I am building a front end to a Russian dictionary database (SQLite). I've
now gotten to the point where my scripts are ready to retrieve the data:

   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

Table RDTKeys has both Russian and English words in column RDTKey. When the
word in field SearchTarget is English, locResult returns the expected
results. When it is a Russian word, the records are never found.

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






More information about the use-livecode mailing list