Problem with display characters "≥"

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
KAMIKAZE
Posts: 7
Joined: Thu 14 Apr 2011 21:40

Problem with display characters "≥"

Post by KAMIKAZE » Thu 14 Apr 2011 21:55

Hello,

I'm using UniDaс for mysql and mssql, and cxgrid to show table data. So I have a problem with character "≥" it shows" like "?"

Here is example
Image

On the top it's SQLyog program, and bottom my program. So sqlyog can display character correctly.

p.s. sorry for bad eng.

AndreyZ

Post by AndreyZ » Fri 15 Apr 2011 13:13

Hello,

To solve the problem, you should set the UniConnection.SpecificOptions.UseUnicode option to True when you are working with MySQL server.

KAMIKAZE
Posts: 7
Joined: Thu 14 Apr 2011 21:40

Post by KAMIKAZE » Fri 15 Apr 2011 18:37

but i'm using MSSQL.

KAMIKAZE
Posts: 7
Joined: Thu 14 Apr 2011 21:40

Post by KAMIKAZE » Fri 15 Apr 2011 19:18

Well, try to insert

INSERT INTO `test`.`tablename1`
(`dsdf`
)
VALUES
(' ≥98%'
);

And Then open in any MySql, or MSSql. FOr me via my program it's '?'. But in sqlyog or SQL Server Management Studio all ok.

AndreyZ

Post by AndreyZ » Mon 18 Apr 2011 09:14

In the case you described above UniDAC sends strings to the server in the AnsiString format. To avoid the problem, you should use parameters in the following way:

Code: Select all

UniQuery.SQL.Text := 'insert into tablename1(dsdf) values(:dsdf)';
UniQuery.ParamByName('dsdf').AsString := '≥98%';
UniQuery.Execute;

KAMIKAZE
Posts: 7
Joined: Thu 14 Apr 2011 21:40

Post by KAMIKAZE » Mon 18 Apr 2011 09:45

Ok. I see.
Maybe I not described well in first post what I need to do.
My program never wrote anything in the database, only reading. The data is already in database and was inserted by other program, correctly inserted. And other programs display it correctly, but not my.

The query, that I give as example to use in SQLyog or SQL Server Management Studio, just to insert this data. And next try to display it using unidac components.

AndreyZ

Post by AndreyZ » Mon 18 Apr 2011 14:20

This situation can be caused by using a Delphi version earlier than Delphi 2009, because earlier versions of Delphi don't support unicode. Please check this problem using ADO components, and inform us about the results.

KAMIKAZE
Posts: 7
Joined: Thu 14 Apr 2011 21:40

Post by KAMIKAZE » Mon 18 Apr 2011 14:27

Hmm, I'm using D7. OK, I will try last version.

KAMIKAZE
Posts: 7
Joined: Thu 14 Apr 2011 21:40

Post by KAMIKAZE » Mon 18 Apr 2011 21:41

Tested with Delphi XE.
Test passed :D
So moving to new version.

Post Reply