-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 12/30/2010 02:36 PM, Gary Carter wrote: > A hex dump of database files shows for some files all the strings (including > schemas) > are in UTF-8, and sometimes all the strings are in UTF-16. > > How do I control this?
Note that you do not need to "control" it. The SQLite APIs behave exactly the same no matter what the actual database encoding is. In general you never need to know or care. This means you can call the UTF16 or UTF8 SQLite APIs at the same time in the same program and you will get the same answers no matter what encoding the database file uses. ie the SQLite API works on Unicode strings always. Because the database file encoding controls which bytes are used to represent Unicode strings, you can set it as others have answered as an optimization. For example if most of your text has codepoints above U+07FF then it will take fewer bytes to use UTF16. If you mostly use the UTF16 SQLite apis then using the same for the file encoding will result in fewer internal conversions. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk0esXgACgkQmOOfHg372QRZjwCdHOECh+V2JbQCTJTu/9zo/Ka8 j9MAniisu14AjmcDWnTi5OxfZo1cNEEq =gcam -----END PGP SIGNATURE----- _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

