Loss of unicode characters when read from DB

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
nszmnsky
Posts: 11
Joined: Wed 21 May 2014 17:07

Loss of unicode characters when read from DB

Post by nszmnsky » Thu 22 May 2014 01:06

Using SQLite in an FMX application, I have entries in database that include a special character ⌡(0x2321). If I cut and past from the DB into text of component (TMSFMXHTMLText) the character displays correctly however if I read text from database in the program (setting a string variable Prmt := DB.TBL.FieldByName('prmtTEXT').AsString) the displayed character is right paren ')' (character 0x0029). If I edit Prmt variable in debug and insert character (using Character Map from system tools) the display is correct. I also tried using WideString but that didn't work either.

It seems that the issue is on the read from the DB but am I missing something?
Thanks in advance for any insight or troubleshooting suggestions

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

Re: Loss of unicode characters when read from DB

Post by AlexP » Thu 22 May 2014 11:38

Hello,

For correct display of unicode symbols, you should enable the following option:

Code: Select all

LiteConnection1.Options.UseUnicode := True;

nszmnsky
Posts: 11
Joined: Wed 21 May 2014 17:07

Re: Loss of unicode characters when read from DB

Post by nszmnsky » Fri 23 May 2014 02:40

That was the solution. Thanks! I simply overlooked that connection would control unicode use.

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

Re: Loss of unicode characters when read from DB

Post by AlexP » Fri 23 May 2014 09:33

You are welcome. Feel free to contact us if you have any further questions.

Post Reply