On 2017/08/07 9:01 PM, x wrote:
Thanks Ryan for going to the trouble of typing that out. Hope you’re not a one 
fingered typewriter like myself. The borland related stuff is welcome but I 
still can’t say I’m any less confused by it all.

I’m having a bad day today. I’ve spent most of it trying to fathom this stuff out. 
Igor & Gunter were correct earlier. The ‘\u0085’ is changed to ‘?’ before the 
string is anywhere near sqlite. Why I don’t know. It doesn’t seem unreasonable to 
want to put a Unicode code into a UnicodeString. As regards the hex(char(133)) 
returning C285, following the posts by Nico and Richard I’m wondering if it’s 
because I’m using SQLite Expert pro on a database that’s encoded in utf-8. I tried 
to change the coding to utf-16 to see if I would get a different result but, while 
the software seemed to accept the request, the request was never completed and no 
feedback was given aside from both the ‘Apply’ and ‘Cancel’ buttons both being 
greyed out for hours (it’s only a small database). I’ve had enough for today though.

Don't worry, I can type faster than I can think (which isn't very fast, and quite evident from the typos!).

I feel your pain though, and hope we can help get you un-discouraged soon. (Imagine that is a word.)

One thing to Note: You can only change the Database encoding at the START of making the Database. Once you put stuff in the database, the encoding is set for life. That is an SQLite quirk - but that said, it wouldn't solve your problem, since the encoding problem (by your account) happens before the database is reached. It's real easy to test.

Use the lowest ranked interface to simply add a string into the DB. By lowest ranked, I mean before it goes through any of your own code, or other wrapper code.

Use direct SQL, such as DB.Execute('INSERT INTO t(v1) VALUES(''Geronimo'');'); (This assumes a table called t with a column v1 of type TEXT. Those are 2 single-quotes btw, not double-quotes).

Use some SQLite tool or the command line to check what ended up in that DB.

If that works, add some Unicode value, like this:
DB.Execute('INSERT INTO t VALUES(''©Geronimo®'');');

If it ends up as something else in that database, follow the call stack chain, see how those look in the debugger initially (which may be different to what you expect, depending on the debugger display encoding), what you are looking for is Change - the moment it changes - you will see which thing is responsible for misinterpreting it, if any.

Tell us more when you did the tests. Don't give up!

Also - make sure that whatever you read it with reads (and can faithfully display) any unicode characters. Often the fault is not yours. The SQLite CLI for instance can read it correctly, but sometimes your computer stdout uses a codepage that doesn't display it correctly. Mail me off-list if you would like an SQLite DB and table with lots of Unicode test data in it and a correct interpretation of it to test with.

Best of luck!
Ryan


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

Reply via email to