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 %
The terminal I'm using claims to be UTF-8 encoded. Is this likely to be the sqlite version? -----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 14:42 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: > I set the schema to TEXT, but that apparently makes no difference! > > I'm using the TCL interface: > > set id "???" > db eval {insert into users (id, name) values (:id, :name)} > When I run this script: sqlite3 db :memory: db eval {CREATE TABLE users(id,name);} set id "???" set name whatever db eval {insert into users (id, name) values (:id, :name)} puts [db eval {SELECT hex(id) FROM users}] The output I see is "C2ACC2ACC2AC", not "C382C2ACC382C2ACC382C2AC". -- 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