Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

Bug in LazReport -> LR_Utils 9 years 1 month ago #6895

  • Javor
  • Javor's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • M.Sc in Computer Science, (ex-)freelancer
  • Posts: 72
  • Thank you received: 8
So as the title says: the bug is in UTF8Desc function and a SIGSEGV exception may occur at different situations (got mine while trying to preview a date with a 'г. ' (a cyrillic letter) at the end of a date field). Easiest ways to solve this are two:
1) patch the function code:
function UTF8Desc(S: string; var Desc: string): Integer;
var
    i,b: Integer;
begin
  i := 1;
  Result := 0;
  SetLength(Desc, Length(S));
  while i<=Length(s) do begin
    b := UTF8CharacterStrictLength(@S[i]);
   if b = 0 then Break; // <-- insert this line here and voila
    inc(i,b);
    inc(Result);
    Desc[Result] := Char(b);
  end;
  Setlength(Desc, Result);
end;
2) Initialize global format settings at application start, for example:
...
  FormatSettings.ShortDateFormat:='dd.mm.yyyy';
  FormatSettings.LongDateFormat:='dd.mm.yyyy';
  FormatSettings.ShortTimeFormat:='hh:nn:ss'; 
...

Please Log in or Create an account to join the conversation.

Last edit: by Javor.

Bug in LazReport -> LR_Utils 9 years 1 month ago #6900

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Thanks Sir
we add this to CT5.3 source
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • Page:
  • 1