On 9/21/06, 卢炎君 <[EMAIL PROTECTED]> wrote:
Hi all
   I use a tool name as sqlitebrowser which from
sourceforge to browsed my db , BTW all data  be decoded as utf-8 (lanugage is 
chinese), the result of retrive is correct display, so I am sure that all data 
has no any problem when be inserted into db. right?
  for example, record be stored as utf8 in db as follow:
[-28, -72, -83] "中"
[-27, -92, -82] "央"
[-25, -108, -75] "电"
[-24, -89, -122] "视"
[-27, -113, -80] "台"
[-32, -126, -73] "・"
...(omit other characters)
, when call a function like follow:
const char* function(..)
{
 ...
 return (const char*)sqlite3_column_text(mpVM, nField);
 ...
}
the return value of result like this:

[-28, -72, -83] "中"
[-27, -92, -82] "央"
[-25, -108, -75] "电"
[-24, -89, -122] "视"
[-27, -113, -80] "台"
[-62, -73, -27] "・" NOTE:value be changed
so I think this is bug

As far as I know sqlite has no bugs in the UTF-8 code, but not all
sqlite clients implement this properly.

SQLite does no checking on the data you use as input (because it can
be binary data, not text) and many GUI's don't make the conversion
to/from UTF-8 before inserting/retrieving data.

Another problem is that the only official sqlite client (the command
line client) doesn't do proper UTF-8 conversion on windows, so windows
users are always faced with this problem one time or another. One
method to test it is if you feed UTF-8 data via an UTF-8 encoded file
instead of using the keyboard. It should work with the file (because
the input is as it should be).

If you only use the C interface to access the database then I only
found UTF-8 support to be wrong when there was a bug in my own code
(as is the case with many sqlite "browsers").


Regards,
~Nuno Lucas

Reply via email to