Hallo,
ich habe ein Problem bei Rave 8.01 in der
Unit RvUtils.
Schalte ich die Bereichsprüfung ein, meckert er.
Bei Stream.Read knallt es.
Delphi-Quellcode:
{$IFDEF UNICODE}
if Len = UnicodeMarker
then begin
// Read the unicode version
CodePage := ReadIndex;
if CodePage = DefaultUnicodeCodePage
then begin
Encoding := TEncoding.Unicode;
end else begin
Encoding := TEncoding.GetEncoding(CodePage);
end;
Len := ReadIndex;
SetLength(Data, Len);
Stream.
Read(Data[0], Len);
Value := Encoding.GetString(Data);
// Skip past the ANSI version
Len := ReadIndex;
Stream.Seek(Len, soFromCurrent);
end else begin
SetLength(S1, Len);
Read(@S1[1], Len);
Value :=
string(S1);
end;
{$ELSE}
SetLength(Value,Len);
Read(@Value[1],Len);
{$ENDIF}
Und das selbe Spiel gibt es ein zweites Mal beim Schreiben:
Delphi-Quellcode:
{$IFDEF UNICODE}
// If unicode chars included then write out unicode value first with unicode marker, then write out plain text
if StringCodePage(Value) <> CP_ACP
then begin
// Write unicode value first
if StringCodePage(Value) = DefaultUnicodeCodePage
then begin
Encoding := TEncoding.Unicode;
end else begin
Encoding := TEncoding.GetEncoding(StringCodePage(Value));
end;
WriteIndex(UnicodeMarker);
WriteIndex(StringCodePage(Value));
Data := Encoding.GetBytes(Value);
WriteIndex(Length(Data));
Stream.
Write(Data[0], Length(Data));
end;
// Convert unicode string to ANSI equivalent for non-unicode
S1 := AnsiString(Value);
WriteIndex(Length(S1));
if Value <> '
'
then begin
Write(@S1[1], Length(S1));
end;
{$ELSE}
WriteIndex(Length(Value));
if Value <> '
'
then begin
Write(@Value[1],Length(Value));
end;
{ if }
{$ENDIF}
Was kann man da machen?
Ciao,
Artur