[patch_done] Problems with accentuation Lazarus 2.7.1

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

elidorio2
Expert Boarder
Expert Boarder
Posts: 159
Joined: 20.08.2006, 05:37
Location: Tapejara -Pr
Contact:

Post by elidorio2 »

Hello Michael,
I created a small example with Zeos and SQLDB, saved in the database the same information. With SQLDB saved normal and Zeos occurred the same problem with the accent.
Attached examples.
Edson
You do not have the required permissions to view the files attached to this post.
Last edited by elidorio2 on 15.10.2012, 19:10, edited 1 time in total.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

elidorio2,

well done Edson. Hope they will find the issue. The wrong encoded strings are passed from the FPC DataSets we use. The TPQConnection using the TBufferDataSet so this is completely different.
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
alexs
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 10.01.2011, 10:46

Post by alexs »

Hi
I made a temporary solution to the UTF8 encoding for FPC 2.7.1.
Now the data is stored in a PostgreSQL database in UTF8 encoding correctly.

I hope that this decision will be made until the FPC team correct the error in the strings.

I'm use:
Lazarus 1.1 r39026 FPC 2.7.1 i386-win32-win32/win64
You do not have the required permissions to view the files attached to this post.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

alexs,

thanks, Alex. I'm willing to point the people to your proposal. But i'm wondering why the escaping functions of postgresql should make this trouble (i got the wrong encoded strings directly from the FPC dataset).

However i hope you understand that we can apply this patch and waiting for the FPC issue.
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
elidorio2
Expert Boarder
Expert Boarder
Posts: 159
Joined: 20.08.2006, 05:37
Location: Tapejara -Pr
Contact:

Post by elidorio2 »

Hello Michael,

One thing I still can not understand!!
From what i understand the problem in this FPC is not?
The encoded strings that SQLdb and Zeos uses is not the same?
Because SQLDB saves correct and Zeos not ?
Please excuse my doubt, I could not understand. Please check ezemplo.zip

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

Post by EgonHugeist »

elidorio2,

the SQLDB components using the TBufferDateset, we use the TWideDataSet. Both are suported from the FPC but our dataset is less maintained.
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
alexs
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: 10.01.2011, 10:46

Post by alexs »

EgonHugeist,
Hi
I continued to look for the problem and found it!

TZPostgreSQLConnection.GetEscapeString function works properly.
The problem in the function TZPostgreSQLStatement.ExecuteUpdate.
The error occurs in an explicit type conversion UTF8String (SQL).

My work code:

if Connection.GetClientCodePageInformations^.Encoding = ceUTF8 then
QueryHandle := FPlainDriver.ExecuteQuery(ConnectionHandle,
{$IF FPC_FULLVERSION>20700}
PAnsiChar(SQL))
{$ELSE}
PAnsiChar(UTF8String(SQL)))
{$ENDIF}
else
QueryHandle := FPlainDriver.ExecuteQuery(ConnectionHandle,
PAnsiChar(AnsiString(SQL)));
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

alexs,

you're great! That's right! FPC2.7.1 uses Codepages now so WE did wrong encode the strings(wondering why the Lazarus display the values wrong while debugging). That was the last statement exec which i've not reworked like all others! I've applied your patch with my simplification. Thanks.

Patch done 1922 \testing.

Edson can you test it?
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
elidorio2
Expert Boarder
Expert Boarder
Posts: 159
Joined: 20.08.2006, 05:37
Location: Tapejara -Pr
Contact:

Post by elidorio2 »

Hi Michael and Alexs,

The problem is solved.

Thank you,


Note: We need to warn the FPC forum that the problem was solved.

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

Post by EgonHugeist »

Hi Edson,

I've allready propsed to close your issue report. They have marked it as resolved. You can close this issue right now.
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
Locked