biffexplorer: Fix ansistrings (replace AnsiToUTF8 by CP1252ToUTF8)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4571 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-03-18 23:46:35 +00:00
parent 222427e8f6
commit 86b86e7ed1

View File

@ -164,7 +164,7 @@ type
implementation implementation
uses uses
StrUtils, Math, lazutf8, StrUtils, Math, lazutf8, lconvencoding,
fpsutils, fpsutils,
beBIFFUtils; beBIFFUtils;
@ -273,7 +273,7 @@ begin
SetLength(sa, n); SetLength(sa, n);
ANumBytes := n; ANumBytes := n;
Move(FBuffer[ABufIndex], sa[1], ANumBytes); Move(FBuffer[ABufIndex], sa[1], ANumBytes);
AString := AnsiToUTF8(sa); // to do: use code page of file AString := CP1252ToUTF8(sa); // to do: use code page of file
end; end;
end; end;
@ -1305,7 +1305,7 @@ begin
ls := Length(FBuffer)-1; ls := Length(FBuffer)-1;
SetLength(sa, ls); SetLength(sa, ls);
Move(FBuffer[FBufferIndex+1], sa[1], ls); Move(FBuffer[FBufferIndex+1], sa[1], ls);
s := AnsiToUTF8(sa); s := CP1252ToUTF8(sa);
end else end else
if FBuffer[FBufferIndex] = 1 then begin if FBuffer[FBufferIndex] = 1 then begin
ls := (Length(FBuffer) - 1) div SizeOf(WideChar); ls := (Length(FBuffer) - 1) div SizeOf(WideChar);
@ -1678,7 +1678,7 @@ begin
numBytes := lenName * sizeOf(ansiChar); numBytes := lenName * sizeOf(ansiChar);
SetLength(ansiStr, lenName); SetLength(ansiStr, lenName);
Move(FBuffer[FBufferIndex], ansiStr[1], numbytes); Move(FBuffer[FBufferIndex], ansiStr[1], numbytes);
s := AnsiToUTF8(ansistr); s := CP1252ToUTF8(ansistr);
end else end else
begin begin
if (FBuffer[FBufferIndex] and $01 = 0) //and (not IgnoreCompressedFlag) if (FBuffer[FBufferIndex] and $01 = 0) //and (not IgnoreCompressedFlag)
@ -1686,7 +1686,7 @@ begin
SetLength(ansiStr, lenName); SetLength(ansiStr, lenName);
numbytes := lenName*SizeOf(ansiChar) + 1; numbytes := lenName*SizeOf(ansiChar) + 1;
Move(FBuffer[FBufferIndex + 1], ansiStr[1], lenName*SizeOf(AnsiChar)); Move(FBuffer[FBufferIndex + 1], ansiStr[1], lenName*SizeOf(AnsiChar));
s := AnsiToUTF8(ansiStr); s := CP1252ToUTF8(ansiStr);
end else begin end else begin
SetLength(wideStr, lenName); SetLength(wideStr, lenName);
numBytes := lenName*SizeOf(WideChar) + 1; numBytes := lenName*SizeOf(WideChar) + 1;
@ -2044,7 +2044,7 @@ begin
numBytes := len*SizeOf(AnsiChar) + 1; numBytes := len*SizeOf(AnsiChar) + 1;
SetLength(ansiStr, len); SetLength(ansiStr, len);
Move(FBuffer[1], ansiStr[1], len*SizeOf(AnsiChar)); Move(FBuffer[1], ansiStr[1], len*SizeOf(AnsiChar));
s := AnsiToUTF8(ansiStr); s := CP1252ToUTF8(ansiStr);
if FCurrRow = Row then begin if FCurrRow = Row then begin
FDetails.Add('Encoded document and sheet name:'#13); FDetails.Add('Encoded document and sheet name:'#13);
if s[1] = #03 then begin if s[1] = #03 then begin
@ -3188,7 +3188,7 @@ begin
numbytes := nchar; numbytes := nchar;
SetLength(ansistr, nchar); SetLength(ansistr, nchar);
Move(FBuffer[FBufferIndex], ansistr[1], nchar); Move(FBuffer[FBufferIndex], ansistr[1], nchar);
s := AnsiToUTF8(ansistr); s := CP1252ToUTF8(ansistr);
ShowInRow(FCurrRow, FBufferIndex, numbytes, s, ShowInRow(FCurrRow, FBufferIndex, numbytes, s,
'Character array of the shortened file path and name (no unicode string header, always 8-bit characters, zero-terminated)'); 'Character array of the shortened file path and name (no unicode string header, always 8-bit characters, zero-terminated)');
inc(n); inc(n);
@ -5170,7 +5170,7 @@ begin
begin begin
SetLength(ansistr, len); SetLength(ansistr, len);
Move(FBuffer[FBufferIndex+2], ansistr[1], len); Move(FBuffer[FBufferIndex+2], ansistr[1], len);
s := AnsiToUTF8(ansistr); s := CP1252ToUTF8(ansistr);
numbytes := 2 + len; numbytes := 2 + len;
end; end;