Actually the TCL and Sqlite are running on QNX. The web client (Firefox) is 
running on Windows.

I also have an Ubuntu 12.04 VM, so have tried using Firefox from there to 
connect, and get the same result.

However, the Sqlite and TCL combination on the Linux VM do behave as expected - 
they are a later version than is on the QNX host.

This means I probably need to update the QNX host to the latest versions.

Thanks for all your help.

Glyn.

-----Original Message-----
From: sqlite-users-bounces at mailinglists.sqlite.org 
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp
Sent: 17 February 2016 15:11
To: SQLite mailing list
Subject: Re: [sqlite] Possible error using length on UTF-8 characters

On 2/17/16, Glyn Jones <glynj at bsquare.com> wrote:
> My code behaves differently:
> % package require sqlite3
> 3.8.11.1
> % sqlite3 db :memory:
> % db eval {CREATE TABLE users(id,name);} % set id "???"
> ???
> % db eval {insert into users (id, name) values (:id,:id)} % db eval 
> {select hex(id) from users} C382C2ACC382C2ACC382C2AC %
>

You must be running on windows.  This is a case of TCL converting the content 
of the script file as it reads it in to execute it.

I suggest you work around the problem by using only ASCII characters in your 
TCL script, and using \u0000 escapes for any unicode characters you need.

To verify, try adding "puts [string length $id]" to the script, and see that it 
does indeed show $id set to a 6-character string.

package require sqlite3
sqlite3 db :memory:
db eval {CREATE TABLE users(id,name);}
set id "???"
puts [string length $id]
set name whatever
db eval {insert into users (id, name) values (:id, :name)} puts [db eval 
{SELECT hex(id) FROM users}]


--
D. Richard Hipp
drh at sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to