Reputation: 67
I'm having some troubles with FDQuery (FireDac) that I really can't get what's going wrong. I used to have the same code on Delphi 7 + ZeosMySQL and this issue did not happen.
Now, on Delphi 10 Seattle + FireDac, exactly the same code brings some 'chinese' characters. Here's my example:
My table (using MySQL 4.1):
CREATE TABLE `tabdollar` (
`CODIGO` INT(11) NULL DEFAULT NULL,
`DOLLAR` FLOAT(16,2) NOT NULL DEFAULT '0.00',
`EMPRESA_USU` VARCHAR(30) NOT NULL DEFAULT '',
INDEX `CODIGO` (`CODIGO`))
COLLATE='latin1_swedish_ci'
ENGINE=MyISAM;
I wrote this simple code on a button to show me the result on a label:
qryAux.Close;
qryAux.SQL.Clear;
qryAux.SQL.Text := 'show columns from tabdollar';
qryAux.Open;
Label1.Caption := qryAux.FieldByName('Type').AsString;
This code on Delphi 7 it show the columns type or name correctly. On Delphi 10 Seattle it shows some different characters (probably chinese or japanese, I really don't know).
Does anyone have an idea why this is happening? Is it there some property on FireDac Query to bring the correctly characters?
Thanks
Upvotes: 1
Views: 700
Reputation: 36
Pretty sure this is an ANSI / UNICODE issue.
Delphi 7 was ANSI (= could not support "chinese" characters), 10 Berlin is UNICODE.
Try using
qryAux.FieldByName('Type').AsANSIString;
and see whether this shows the text you expect.
If it does I have not solved your problem, but you can try to convert your data to UNICODE ...
Upvotes: 2