LazReport, fix reading some frf format reports, when system encoding is UTF8, issue #23058

git-svn-id: trunk@39530 -
This commit is contained in:
jesus 2012-12-13 21:19:23 +00:00
parent 5e261a54e0
commit eda22758a1

View File

@ -20,7 +20,7 @@ uses
{$IFDEF WIN32}
Windows,
{$ENDIF}
LCLType,LCLIntf,LCLProc,LazUTF8;
LCLType,LCLIntf,LCLProc,LConvEncoding;
procedure frReadMemo(Stream: TStream; l: TStrings);
@ -124,9 +124,13 @@ begin
SetLength(s, n);
Stream.Read(s[1], n);
if frVersion<=23 then
// this string is not UTF-8 encoded, wish it a good
// luck and assume it's encoded en current codepage
s := SysToUTF8(s);
// this string is not UTF-8 encoded, give developer a chance
// to specify from what encoding should it convert from to UTF8
// if developer do not specify an encoding function assume CP1250
if Assigned(ConvertAnsiToUTF8) then
s := ConvertAnsiToUTF8(s)
else
s := CP1250ToUTF8(s);
l.Add(s);
b := 0;
Stream.Read(b, 1);