Page 1 of 1

SQLite - International Characters

Posted: Thu Nov 01, 2007 6:17 pm
by andyh1234
Hi,

Is there any way to create a field in a table in SQLite that will accept international characters, they always seem to get messed up when I add them.

Im creating the table as follows - am I doing something wrong?

get revOpenDatabase ("sqlite",dbPath,,,,,)
put it into gdbID
revExecuteSQL gDBId, "CREATE TABLE Progress(" & \
"Id INTEGER PRIMARY KEY AUTOINCREMENT" & comma & \
"user TEXT NULL" & comma & \
"field1 TEXT NULL" & comma & \
"field2 TEXT NULL" & comma & \
"notes TEXT NULL)"

It works fine, until you try to insert something other than an international character or trademark symbol etc.

Thanks

Andy

Posted: Mon Nov 05, 2007 1:21 pm
by Janschenkel
Hi Andy,

Internally, Revolution works with UTF-16, which can be dependent on the host platform. It is generally advisable to use UTF-8 on the 'end-points', where data goes in or comes out.

Code: Select all

put uniDecode(theString,"UTF8") into theUTF8String
Another option is to rely on the htmlText property, where diacritical characters are converted to numbers.

Code: Select all

set the text of the templateField to theString
put the htmlText of the templateField into theHtmlString
Hope this helped,

Jan Schenkel.

Posted: Thu Nov 08, 2007 1:31 am
by andyh1234
Thanks Jan, that helped a lot!

Andy