Stringreplace corrupts my strings
Original Reporter info from Mantis: ocean
-
Reporter name:
Original Reporter info from Mantis: ocean
- Reporter name:
Description:
This code shows message "Bug!". I have simplified it from larger program.
Tested 1.1.-37904-fpc-2.7.1-20120710-win32
Problem is NOT present 0.9.30.4 / 2.60
procedure test(s: string);
var i, j: integer;
begin
i:=pos('€', s); //1
s:=stringreplace(s, 'anything', 'anything2', []); // do nothing
j:=pos('€', s); //0
if i<>j then showmessage('Bug!');
end;
procedure TForm1.Button1Click(Sender: TObject);
var o: olevariant;
begin
o:=UTF8Decode('€');
test(UTF8Encode(o));
end;
Mantis conversion info:
- Mantis ID: 22501
- Platform: Win32
- Version: 2.7.1
- Monitored by: » ludob (Ludo Brands), » @theo222 (theo)