I'm Testing your unidac component, but I can't get it working with UTF8 in my DB. I have set Charset to UTF8, UseUnicode = True, but still not showing correct Values.
mySQL and UniCode
mySQL and UniCode
Hi,
I'm Testing your unidac component, but I can't get it working with UTF8 in my DB. I have set Charset to UTF8, UseUnicode = True, but still not showing correct Values.
I'm Testing your unidac component, but I can't get it working with UTF8 in my DB. I have set Charset to UTF8, UseUnicode = True, but still not showing correct Values.
-
AndreyZ
Hello,
You cannot show Unicode characters in the standard visual components in all Delphi versions earlier than Delphi 2009 because they do not support Unicode. Delphi 2009 and higher versions have full Unicode support. To solve the problem, you should use Delphi 2009 at least, or you can use some third-party visual components for displaying data with Unicode support.
You cannot show Unicode characters in the standard visual components in all Delphi versions earlier than Delphi 2009 because they do not support Unicode. Delphi 2009 and higher versions have full Unicode support. To solve the problem, you should use Delphi 2009 at least, or you can use some third-party visual components for displaying data with Unicode support.
I'm using XE2
-
AndreyZ
I have created the following table:, inserted the following data:, and used the following code:Data from the testutf table was correctly shown in the TDBGrid component. Please check if this example works for you.
Code: Select all
CREATE TABLE testutf
(
id INT(11) NOT NULL AUTO_INCREMENT,
txt VARCHAR(40) DEFAULT NULL,
PRIMARY KEY (id)
)
ENGINE = INNODB
AUTO_INCREMENT = 1
CHARACTER SET utf8
COLLATE utf8_general_ci;Code: Select all
INSERT INTO testutf (txt) VALUES ('ѮѶѪ')Code: Select all
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
UniConnection1.ProviderName := 'MySQL';
UniConnection1.Server := 'server';
UniConnection1.Port := 3306;
UniConnection1.Database := 'database';
UniConnection1.Username := 'username';
UniConnection1.Password := 'password';
UniConnection1.LoginPrompt := False;
UniConnection1.SpecificOptions.Values['UseUnicode'] := 'True';
UniQuery1.Connection := UniConnection1;
UniQuery1.SQL.Text := 'select * from testutf';
UniDataSource1.DataSet := UniQuery1;
DBGrid1.DataSource := UniDataSource1;
UniQuery1.Open;
end;