Thanks, Trevor. I'll try it. One more question - is there any way to insert utf-16 string from sqlite3.exe? As I understand I can't use syntax like this: insert into t values (X'31003700', 1);
-----Original Message----- From: Trevor Talbot [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 11, 2007 10:42 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] how to cast utf16 text to int? On 12/5/07, Maxim V. Shiyanovsky <[EMAIL PROTECTED]> wrote: > I have table that holds values of different types in utf16. > I also know value type for the current row. > How should I cast value to compare it with integer? > > This test shows 1 instead of 17 that I expected. > > sqlite> create table t (value text, field_type int); > sqlite> insert into t values (X'31003700', 1); > sqlite> select value from t; > 1 Based on your description, I think you mean you're trying to store a string of Unicode characters, and you're just working with them as UTF-16 in your application. In that case, the problem is that you're trying to use blobs. Use text instead. sqlite3_bind_text16() will let you use UTF-16 in your application, and SQLite will take care of the on-disk encoding and byte order. ------------------------------------------------------------------------ ----- To unsubscribe, send email to [EMAIL PROTECTED] ------------------------------------------------------------------------ ----- ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------