Page 1 of 1

delphi7 unidac sqlite3 can't show the chinese data

Posted: Thu 22 Jul 2010 10:43
by sefeng1982
hi:
i met a problem in my project. i use the unidac connect the sqlite database. the problem is cant't show the chinese data in the unidac components.
the uniconnection options-useunicode is true. the sqlite pragma encoding is utf8. how can i do that can show the right chinese data.
sorry for my terrible english.

Posted: Fri 23 Jul 2010 16:11
by bork
Hello

If you set the UseUnicode specific option to True then text will be read from a SQLite database in the UTF16 encoding. If you want to get this text in the UTF8 encoding then you should get the text in the UTF16 encoding (AsWideString) and convert it to the UTF8 encoding (for example you can use WinApi function WideCharToMultiByte).

Posted: Mon 18 Oct 2010 15:21
by dkittell
Sorry for what may seem a dumb question but how do you turn on the UseUnicode option for SQLite

Posted: Wed 20 Oct 2010 09:42
by AlexP
hello,

You can set the UseUnicode option like

UniConnection1.SpecificOptions.Values['UseUnicode']:='TRUE';

or in the Object inspector open the SpecificOptions property and in the Options tab set it

Posted: Wed 20 Oct 2010 15:36
by dkittell
Wonderful, this has fixed this problem for me