1. My understanding is that it will convert between UTF-8 and UTF-16
when you use these functions. I haven't tested this though, so you might
try a simple test app just to make sure.

2. UTF-8 is NOT the same as ASCII for values greater than 127.
Similarly, UTF-16 is NOT the same as UCS-2 (the wide "Unicode" chars
used by MS APIs), though it looks the same at low values. UTF-16 is a
multibyte character set, while UCS-2 is always 2 bytes per character.
You have to convert these values. Better to just use the regular UTF8
versions.

If you are only now internationalizing your code, and you've been
passing 8bit strings to SQLite, you may already have a problem, since
some of the data stored may be invalid if you attempt to treat it as a
UTF-8 string. You may find that you'll need to dump the data, then
convert from ASCII to UTF-8 and rebuild the database.

John

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of A.J.Millan
Sent: Thursday, October 29, 2009 5:14 AM
To: sqlite-users@sqlite.org
Subject: [sqlite] Some clarification needed about Unicode

Hi list:

After some years using this wonderful tool, I embraced the 
internationalization of a application, and despite some readings in this

list, and muy own test -not conclusive-, I still have some obscure
corners.

[1] Supposing some textual data already inserted as UTF-8 (default mode)
in 
a dBase, and a connection opened with sqlite3_open(): Does a 
sqlite3_column_text16 retrieves a correct UTF-16 content? Is to say, do 
SQLite the convertion internally?


[2] Assuming the previous -or a UTF-16 content obtained by any other
means- 
and an develop using M$ VCpp for Windows32, say sizeof(w_char) == 2: can
be 
used the UTF-16 content to directly fill an w_char string?

Any clarification would be greatly appreciated.

A.J.Millan

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

Reply via email to