John:

> 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.

Really, here you touched tangentially the core of my question. Besides all 
those great theories, at last I have UTF-8 encoded data in a dBase, and the 
UCS-2 encoded data of the MS Win32 API (w_chars in muy Cpp app). The 
question is: What is the concrete way to and from that w_chars to the UTF-8 
that need SQLite? (my guess is use UTF-8 to the stored data) Can I use 
wcstombs() or even WideCharToMultiByte()? -this last seem a nightmare to 
me-.

> 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.
>

Really, preventing future possible problems, my textual data was stored as 
blob. The idea is rebuild converting from 8 bits ASCII to UTF-8. Then the 
question: can be done with mbstowcs() prior to using sqlite3_bind_text()?

A.J.Millan

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

Reply via email to