Page 1 of 1
Problem with display characters "≥"
Posted: Thu 14 Apr 2011 21:55
by KAMIKAZE
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
On the top it's SQLyog program, and bottom my program. So sqlyog can display character correctly.
p.s. sorry for bad eng.
Posted: Fri 15 Apr 2011 13:13
by AndreyZ
Hello,
To solve the problem, you should set the UniConnection.SpecificOptions.UseUnicode option to True when you are working with MySQL server.
Posted: Fri 15 Apr 2011 18:37
by KAMIKAZE
but i'm using MSSQL.
Posted: Fri 15 Apr 2011 19:18
by KAMIKAZE
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.
Posted: Mon 18 Apr 2011 09:14
by AndreyZ
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;
Posted: Mon 18 Apr 2011 09:45
by KAMIKAZE
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.
Posted: Mon 18 Apr 2011 14:20
by AndreyZ
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.
Posted: Mon 18 Apr 2011 14:27
by KAMIKAZE
Hmm, I'm using D7. OK, I will try last version.
Posted: Mon 18 Apr 2011 21:41
by KAMIKAZE
Tested with Delphi XE.
Test passed
So moving to new version.