Full Unicode/Ansi-Support in /testing branch

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

User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Ivan,

success or again problems?

Btw. you can also use the ClientCodePage=WIN1251 for example. But then never ever use ZQuery1.SQL.Text = UTF8Encode('insert into table1 values 'да не стесьняйся, присоединяйся!';');

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
mrLion
Senior Boarder
Senior Boarder
Posts: 71
Joined: 20.03.2010, 10:17

Post by mrLion »

EgonHugeist, later.... no time today and on this week. no offense, but after May 9! :)
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Sorien,

I did a first step and grow the RowBuffer to 64KB. But it's still static.

Mark and me have a solution but it's not implemented yet and not done in two days.
So i'll inform you if we've a perfect solution.

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Sorien
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 18.04.2012, 12:29

Post by Sorien »

EgonHugeist,

thx for looking at this, even 64K buffer is fine for me, couse i'll have probably just one such a big query...
Zeos 7.0 - egonhugeist branch, DB charset and collation UTF-8, Connection UTF-8, Win7 64Bit
Serg77
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 08.05.2012, 00:26
Location: Belgorod

Post by Serg77 »

Hello, I decided not to produce new topics here discussed problems with the encoding UTF8.
Declare encoding in connection with BD MySQL so

Code: Select all

ZQuery1.SQL.Clear;
ZQuery1.SQL.Add ('SET NAMES `cp1251`;');
ZQuery1.ExecSQL;
By analogy to the Propertis ZConnection codepage = cp1251 (tried both versions), if I change cp1251 to utf8 in both cases, this error: "Row buffer width exceeded. Try using fewer or longer columns in SQL query."
The database encoding set utf8_unicode_ci. How do fix it?
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Serg77,

do you use my \testing-egonhugeist branch? If not then i hope you use D7-D2007 or FPC without Lazarus. Otherwise you'll get allway wrong decodet string values.

If you use my branch then please use the TZConnection.ClientCodePagw = cp1251; Then Zeos is also informed about the string-encoding which you send and receive from the server.If you use the trunk or testing then use TZconnection.Properties. Text := 'codepage = utf8/cp1251';. On your collation i can see you use MySQL.
"Row buffer width exceeded. Try using fewer or longer columns in SQL query
Is that the true Exception you get here? I only know about an exception:
Row buffer width exceeded.
Like you can see user Sorien also had this problem. In my package i grow the RowBuffer temporary.


Can you tell me is this Exception raised from Zeos or from the Server?

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Serg77
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 08.05.2012, 00:26
Location: Belgorod

Post by Serg77 »

Michael, use Zeos alpha 7 to Delphi 2010, because the following in Delphi 2009 does not support unicode (need to read not only English and Russian). Produces an error component. Is registered error in src\core\ZMessages.pas line 555

Code: Select all

SRowBufferWidthExceeded = 'Translate: Row buffer width exceeded. Try using fewer or longer columns in SQL query. ';
Want to add in Delphi 7 with Zeos 6.6.5 stable such an error does not occur. But naturally the text is derived from the base unreadable due to the encoding standard components DBEdit, DBMemo...
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Serg77,

Ahhhh somebody who changes the language setting in the Zeos.inc!

Alpa7 is'nt the right answer, smile.
It is possible that you use an old deprecated snapshot.
Go to the first post of this thread. Use TortoiseSVN to download the testing-egonhugeist branch and install this.So you're always up to date.
If you use UTF8 as charset just set TZConnectionn.PreprepareSql := True; Then you don't need to change your sources by updating from D7 to 2010.
And the RowBuffer Exception should be gone too.

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Serg77
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 08.05.2012, 00:26
Location: Belgorod

Post by Serg77 »

Michael, the error "Row buffer width exceeded ..." preserved (after updating component) also lost to display of the russian language in the visual components of the DB.
Then you don't need to change your sources by updating from D7 to 2010.
Components of DB in D7 will not be able to display UTF8 text.
After upgrading Zeos in D7 exact same error appeared in UTF8 and russian characters were lost in the cp1251.
Serg.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Which Revision do you use now?
Michael, the error "Row buffer width exceeded ..." preserved (after updating component)
Uff what for a select could this be? Can you give me an example?
also lost to display of the russian language in the visual components of the DB.
That's possible for D7. Fund a small leak. Please update.

D7: use ZConnection.ClientCodePage := 'cp1251'; then Connect;
You can also use ZConnection.ClientCodePage = UTF8; but then use TZConnection.UTF8AsWideField := True;
To display all Characters right you need TNT components or something like this.

D2010: ZConnection.ClientCodePage := either cp1251 or UTF8;

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Serg77
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 08.05.2012, 00:26
Location: Belgorod

Post by Serg77 »

Michael, version Zeos 7.0.0-dev updated yesterday via TortoiseSVN.
Uff what for a select could this be? Can you give me an example?
Example? Hmm, in general terms as follows:
Create an SSH Tunnel;
Then ZConnection1.Connect; and
ZQuery1.SQL.Clear;
ZQuery1.SQL.Add ('SELECT * FROM tablename;');
ZQuery1.Open;
In the events TForm1.ZConnection1AfterConnect put
ZQuery1.SQL.Clear;
ZQuery1.SQL.Add ('SET NAMES `cp1251`;');
ZQuery1.ExecSQL;
or (equivalently) in ZConnection1 Properties, writing CodePage = cp1251
If change the cp1251 to utf8 is in the process of connecting the above gives an error.
That's like all
If the ZConnection1 Properties prescribe ClientCodePage: = 'cp1251', there is no reaction (instead of the russian character ???). Also probyval all offered advice, the reaction is the same. If specified as in (smile) example of a russian characters do not appear in both environments, D7 and D2010.
I feel I have to go back to the D7+Zeos 6.6.6-stable using TNT (although I do not like this set), plus a reworking of the code (which was created about 1.5 years) for TNT.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Serg77,

thaaaaaank you for that code sequence!!! Now i know what the problem is here!!!!!

ZQuery1.SQL.Add ('SET NAMES `cp1251`;'); is SERVER equal to ClientCodePage := `cp1251` or ZConnection.Properties.Text := codepage=cp1251; !! Yes it is.

But NOT equal to \testing-egonhugeist ort Zeos7! Why this:

If no ClientCodePage or Properties.Codepage is set then i'm reading the default from the Server settings. And i set some Prameters to a spezial generic Object which is the base-object for the most Zeos descendant objects. In your case i set some UTF8 Parameters because this is your Database-default setting.
I have to know which string-encoding is coming in to decide what is to do with that String to display it right! Open ZCompatibility.pas. There are two functions which are doing this right: TZCodePagedInterfacedObject.ZDbcString/ZPlainString.

Zeos is now prepared to show also Ansi 1Byte characters and Unicode-Chars on a unicode IDE.

But what happens if you change this after connect? Everything is wrong encoded/decoded. Simply this is the BIG problem.
Maybe to avoid this strange behavior i've to scan all queries you are sending to the Server and this isn't wanted for me.

Don't you think this setting is enough on connecting? You can change this also in runtime but the easiely set the ClientCodePage, reconnect and everything is fine.

Do you understand me?

Michael

Btw. for D7-2007 i plan a extra Zeos-ClientCodePage like ZUTF8AsAnsi which decodes the Strings..
And you realy don't need to use this deprecated D7 compiler any longer...
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

Hint
Maybe rename
testing-egonhugeist/packages/delphi16/ in testing-egonhugeist/packages/delphi_XE2/
testing-egonhugeist/packages/delphi15/ in testing-egonhugeist/packages/delphi_XE/
and so on

Because it is difficult to understand for beginners where to get the package

And need small install_readme.txt in each dir
Lazarus 1.0.8 fpc 2.6.0
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

My corrections to Zeos 7 testing-egon hugeist rev 1270.
It compiles and runs in Delphi XE2 upd 4 Win32 and Win64.

Michal Abramczyk
You do not have the required permissions to view the files attached to this post.
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

Small correction to ZDbcCache.pas

Michal Abramczyk
You do not have the required permissions to view the files attached to this post.
Locked