14.10.2011 20:23, Hans-Peter Diettrich wrote:
Apart from the mentioned implementation flaws, I came across severe problems with the new AnsiString *model* in general. Let's play around with the Pos() function, which certainly is an inevitable part of any stringhandling.

A general function
 function Pos(SubStr: T1; Str: T2): integer;
should return the character index of SubStr in Str, i.e. Str[i] should definitely be the begin of SubStr within Str.
Just think of Pos() as it only compares bytes. AnsiPos() should care about encoding too. As I remember AnsiPos() has AnsiString arguments instead of RawByteString and therefore the conversion will be made before the byte compare.

Best regards,
Paul Ishenin.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to