How to handle unicode data
Posted: Thu 29 Jan 2009 07:52
Hello,
I'm using the v4.40.0.14 dbExpress for MySQL driver and trying to access a database using utf8 charset with Delphi 2009.
I saw in the readme the CRSQLConnection can handle Extra options and I have set them in Params:
UseUnicode=True
Charset=utf8
When I add all the Fields (on TSQLQuery) varchar fields get mapped to TStringField therefore accented characters are not displayed properly.
AFAIK they should be mapped to TWideStringField. I could not figure out what to do in order to achieve this.
Just a sidenote: When using the built-in CodeGear MySQL driver I have to set the parameter ServerCharSet=utf8 on the SQLConnection to get the expected result (varchar to be mapped to TWideStringField)
Thank you
I'm using the v4.40.0.14 dbExpress for MySQL driver and trying to access a database using utf8 charset with Delphi 2009.
I saw in the readme the CRSQLConnection can handle Extra options and I have set them in Params:
UseUnicode=True
Charset=utf8
When I add all the Fields (on TSQLQuery) varchar fields get mapped to TStringField therefore accented characters are not displayed properly.
AFAIK they should be mapped to TWideStringField. I could not figure out what to do in order to achieve this.
Just a sidenote: When using the built-in CodeGear MySQL driver I have to set the parameter ServerCharSet=utf8 on the SQLConnection to get the expected result (varchar to be mapped to TWideStringField)
Thank you