Full Unicode/Ansi-Support in /testing branch
Moderators: gto, EgonHugeist, olehs
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
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
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/
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/
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
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
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/
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/
Hello, I decided not to produce new topics here discussed problems with the encoding UTF8.
Declare encoding in connection with BD MySQL so
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?
Declare encoding in connection with BD MySQL so
Code: Select all
ZQuery1.SQL.Clear;
ZQuery1.SQL.Add ('SET NAMES `cp1251`;');
ZQuery1.ExecSQL;
The database encoding set utf8_unicode_ci. How do fix it?
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
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.
Can you tell me is this Exception raised from Zeos or from the Server?
Michael
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.
Is that the true Exception you get here? I only know about an exception:"Row buffer width exceeded. Try using fewer or longer columns in SQL query
Like you can see user Sorien also had this problem. In my package i grow the RowBuffer temporary.Row buffer width exceeded.
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/
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/
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
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...
Code: Select all
SRowBufferWidthExceeded = 'Translate: Row buffer width exceeded. Try using fewer or longer columns in SQL query. ';
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
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
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/
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/
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.
After upgrading Zeos in D7 exact same error appeared in UTF8 and russian characters were lost in the cp1251.
Serg.
Components of DB in D7 will not be able to display UTF8 text.Then you don't need to change your sources by updating from D7 to 2010.
After upgrading Zeos in D7 exact same error appeared in UTF8 and russian characters were lost in the cp1251.
Serg.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Which Revision do you use now?
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
Uff what for a select could this be? Can you give me an example?Michael, the error "Row buffer width exceeded ..." preserved (after updating component)
That's possible for D7. Fund a small leak. Please update.also lost to display of the russian language in the visual components of the DB.
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/
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/
Michael, version Zeos 7.0.0-dev updated yesterday via TortoiseSVN.
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.
Example? Hmm, in general terms as follows:Uff what for a select could this be? Can you give me an example?
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.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
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...
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/
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/
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
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