On 26 Sep 2009, at 2:04pm, aj wrote:

> what encoding does sqlite_exec() callback function receive data in ?
>
> some tests i've done seem to suggest UTF-8
>
> other tests show chars U+80 to U+FF are returned as single chars with
> values 128-255. (suggesting its not UTF-8)

That would be some kind of extended ASCII, then.  As a test, assuming  
you're using version 3 of SQLite, define one of your columns as  
integer, put an integer in it, and see what sort of data your callback  
gets for that.

> where is *any* documentation about this?

http://www.sqlite.org/c_interface.html

which says in part "

int Callback(void *pArg, int argc, char **argv, char **columnNames){
   return 0;
}

" and then goes through each argument.  I agree it's not in an obvious  
place.  There should probably be a link from 
<http://www.sqlite.org/c3ref/exec.html 
 > to that page or the information should be moved or something.

These days most people are using the more modern  
_prepare,_step_,_finalize system which gives you better control over  
what you can do with each line's data.

Simon.

PS for the docos: the c_interface page also contains a link to 
<http://www.sqlite.org/pragma.html#pragma_show_datatypes 
 > which doesn't exist.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to