Vinnie <thev...@yahoo.com> wrote:
>> From: "Igor Tandetnik" <itandet...@mvps.org>
>> You could convert your file name from UTF-16 to UTF-8, then
>> call sqlite3_open_v2.
>
> Converting the file name is no problem. But I thought that depending
> on how you opened the database (open16 versus open_v2), SQL treats
> your strings differently. I don't care about the encoding used to
> pass the filename, I care about the strings in my table rows.

You can specify encoding explicitly, with "PRAGMA encoding" statement, 
right after the database is created (or rather, right after you call 
sqlite3_open_* on a non-existent file and before you issue any other 
statement; the database is not actually created until the first 
statement needs to write to the file).

> Or does the encoding for the file name used to open the database not
> matter to subsequent SQLite SQL statements? Can I mix and match UTF-8
> and UTF-16 in a table or across multiple tables?

You can mix and match encodings in your application. The database 
encoding determines how strings are actually stored in the file (and 
it's database-wide, not per table). SQLite API converts back and forth 
as necessary.

Igor Tandetnik 



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to