On 12/7/06, Da Martian <[EMAIL PROTECTED]> wrote:
Ok, that does answer one of my questions I think. If I passed something not in UTF-8 to sqlite would it return it exactly the same way I passed it in? From your statement of chaos below I assume it wont if that data somehow violates UTF-8. So I need to get it to UTF-8 or UTF16 before I insert.
SQLite doesn't care much about what you feed it (remember you can also have BLOB's in fields), so if you feed it invalid UTF-8, it's invalid UTF-8 you get on return. The problem is when you then do do things like "SELECT length("<bad UTF-8 string>")", or many other text operations. Then you get wrong results. The biggest problem is when the database generated by your program is then read by UTF-8 aware programs (which should be all, but unfortunely they are not). An example could be an SQLite importer/exporter program, or some SQLite replicator program you get on the net and generates bad data because your data wasn't good in the first place. Also, i you want to hand edit your data with any of the many good SQLite GUI's, you may have problems. If you want to go the simple way (and only do Windows), then use the UTF-16 functions and forget about all this. As an advantage, windows NT internals uses Unicode, so you may have some performance gains in some places (even if negligible most of the time). Regards, ~Nuno Lucas ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------