On 2016/06/24 12:42 AM, Igor Korot wrote:

Your locale should not have any effect on what goes into a SQLite database. All strings must be translated into Unicode before they are passed to the SQLite API. And by 'All strings' I include SQL commands like the ones which create tables and define field names.
If your software works correctly then

* Your locale has no effect on entity names in a SQLite database
* Your code page has no effect on entity names in a SQLite database

If either of these are not true then there is a fault with your programming and 
it should be fixed.
And it is not.
As you can see I presume that whatever I got as a table name is UTF-8
and then I am converting it
to std::wstring.

Thank you.

Hi Igor,
I think the thing that is hard to explain is that when you set SQLite to use UTF-8 (the default in recent versions) it basically means that it /understands/ UTF-8 strings that you feed to it. It does NOT mean that it magically converts strings to UTF-8 or that it ever does any conversion, it only means that when you type UTF-8 or read UTF-8 text from files into it, it will grasp the contents in terms of reading the queries and other things you may have in the file as UTF-8.

What you specify as a table name, or put into the Database as values for fields, does not in any way get altered. Whatever you put into it is what will come out. If you /think/ you have put UTF-8 in there, but something else comes out, it means you did not put UTF-8 in there - and this is why people asked you for are the byte-sequences of the strings you put in. Sometimes it will look like UTF-8 but it may simply be ANSI or such. By the way, there is nothing precluding another code-page to have characters like the German SS - it can (and does) happily exist on many code pages. The fact that you can conjure it up in a CLI or some editor doesn't guarantee UTF-8-ness. [btw: AFAIK Windows console Alt-225, or anything above Alt-127, specifically isn't UTF-8]

I also understand that the way you connect to SQLite might make it hard to control or even be able to read the exact byte-sequences of the strings that go in and out of it... but I'm afraid you have to find a way for us to see what bytes those strings are really made of to help you figure out where it goes wrong (if indeed it does).

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