[patch_done] Bug insert record russian symbols Linux Lazarus

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 »

Hmm here i thing the Grid did not update the TField. Which means press insert on the DBNavigator then type in your russian chars. Change the cursor-position to your id Field. And click post on the Navigator. Are the changes posted? If this is true then Zeos isn't the Problem here...
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 »

Change the cursor-position to your id Field
Yes, problem with update dbgrid

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

Post by ism »

I test with standart sqldb lazarus components IBConnection, bug present, this problem in lazarus
Lazarus 1.0.8 fpc 2.6.0
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

ism,

report the problem to FPC/Lazarus-Forum..
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
marcov
Senior Boarder
Senior Boarder
Posts: 95
Joined: 24.06.2010, 09:17

Post by marcov »

EgonHugeist wrote: Eventually the FPC UTF8ToAnsi doesn't work for Linux..
That's something i wanted to do long times before.
Note that "ansi" is a dangerous term. It might be UTF8.

In bpoth FPC and Delphi terms it means "the system 1-byte encoding", which on *nix can be (and often is in full size distributions) UTF-8

Note that to keep depencies low, on Linux and FreeBSD the "cwstring" unit must be included in the project to enable unicode support (automatic conversions between ansistring and unicodestring, as well as all other conversions provided by FPC).
ism
Zeos Test Team
Zeos Test Team
Posts: 202
Joined: 02.10.2010, 20:48

Post by ism »

In svn lazrus trunk , fixed , test it
http://bugs.freepascal.org/view.php?id=21489
Lazarus 1.0.8 fpc 2.6.0
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

marcov,

marcov wrote: function TZAbstractCachedResultSet.GetString(ColumnIndex: Integer; const CharEncoding: TZCharEncoding = {$IFDEF FPC}ceUTF8{$ELSE}ceAnsi{$ENDIF}): Ansistring;
var
UseEncoding: TZCharEncoding;
WS: WideString;
begin
{$IFNDEF DISABLE_CHECKING}
CheckAvailable;
{$ENDIF}
if CharEncoding = ceDefault then
UseEncoding := ClientCodePage^.Encoding
else
UseEncoding := CharEncoding;

case ClientCodePage^.Encoding of
ceAnsi:
case UseEncoding of
ceAnsi: Result := AnsiString(FRowAccessor.GetString(ColumnIndex, LastWasNull));
ceUTF8: Result := AnsiToUTF8(FRowAccessor.GetString(ColumnIndex, LastWasNull));
ceUTF16:
begin
WS := UTF8ToString(AnsiToUTF8(FRowAccessor.GetString(ColumnIndex, LastWasNull)));
Result := Copy(UTF8Encode(WS), 1, Length(UTF8Encode(WS)));;
end;
{$IFNDEF MSWINDOWS}
ceUTF32: ;
{$ENDIF}
end;
ceUTF8:
case UseEncoding of
ceAnsi: Result := AnsiString(UTF8ToAnsi(FRowAccessor.GetString(ColumnIndex, LastWasNull)));
ceUTF8: Result := AnsiString(FRowAccessor.GetString(ColumnIndex, LastWasNull));
ceUTF16:
begin
WS := FRowAccessor.GetUnicodeString(ColumnIndex, LastWasNull);
Result := Copy(UTF8Encode(WS), 1, Length(UTF8Encode(WS)));;
end;
{$IFNDEF MSWINDOWS}
ceUTF32: ;
{$ENDIF}
end;
ceUTF16: ;
{$IFNDEF MSWINDOWS}
ceUTF32: ;
{$ENDIF}
end;
end;
This function returns always Ansi-one-byte chars so thats absolutly wanted in this case. Do you see issus here?

I only changed the defaults of the cached-resultsets. This is a patch i've implemented because of some old detected bugs (in UTF8-Mode). The theme was editing/posting some ascendent-chars and compare them with source constants. This was impossible with delphi and a Unicode-Connection...
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