delphi7 unidac sqlite3 can't show the chinese data

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sefeng1982
Posts: 2
Joined: Thu 22 Jul 2010 10:35

delphi7 unidac sqlite3 can't show the chinese data

Post by sefeng1982 » Thu 22 Jul 2010 10:43

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.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Fri 23 Jul 2010 16:11

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

dkittell
Posts: 10
Joined: Thu 10 Dec 2009 01:37
Location: Michigan, USA

Post by dkittell » Mon 18 Oct 2010 15:21

Sorry for what may seem a dumb question but how do you turn on the UseUnicode option for SQLite

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 20 Oct 2010 09:42

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

dkittell
Posts: 10
Joined: Thu 10 Dec 2009 01:37
Location: Michigan, USA

Post by dkittell » Wed 20 Oct 2010 15:36

Wonderful, this has fixed this problem for me

Post Reply