unicode Suporte ?

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
solook
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: 20.09.2008, 13:12

unicode Suporte ?

Post by solook »

hello

i installed zeos 7 in delphi2009

so it can not show arabic text as good

i add this code :

memo1.Text:=utf8toansi(ZTable1.FieldByName('arabic').AsString);

and word good ..how can i soled it?
jfr
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 11.04.2009, 07:17
Location: Warszawa
Contact:

Post by jfr »

Maybe the related question. Delphi 2009 with Zeos 7 installed, MySql 5.1, a database with table filled with utf8 values (Polish, Russian and Baltic names). Simple application: a DBGrid on a form, connected to DataSource. When I'm using ADOConnection and ADOTable as DataSource.DataSet then all is OK, I can see all names displayed properly. But ZConnection with ZTable don't work, even after 'SET NAMES utf8' query after ZConnection.Connect. A string with characters pair for all utf8 characters is displayed.
Moreover: let
strValue := qry.FieldByName('utf8field').AsString;
then
1. if qry is ADOQuery, then I can display strValue on control (TEdit, TMemo...) and I have to use AnsiToUtf8(strValue) in html
2. if qry is ZQuery, then I have to use Utf8ToAnsi(strValue) to display it on control and I can put strValue into html.

So why different behaviour for similiar components?

A day later.
OK, probably it's a question for Delphi or MySql. It's strange, but when using ADO all depends on table collation. If set to utf8_general_ci, then ADO behaves like ZEOS, string returned is in utf8. But if table collation is set to specific one, eg utf8_unicode_ci or utf8_polish_ci, then the returned string is ansi, displayable on a form.
For ZEOS changing the collation has no effect.

BTW: but it would be nice to have utf-8 strings displayed properly on dataaware controls connected using ZEOS.
Locked