[fpc-pascal] Base db-indexes on ansicomparestring?

Joost van der Sluis joost at cnoc.nl
Sat Apr 19 22:24:02 CEST 2008


Op zaterdag 19-04-2008 om 22:10 uur [tijdzone +0200], schreef Michael
Van Canneyt:
> 
> On Sat, 19 Apr 2008, Joost van der Sluis wrote:
> 
> > Another question:
> > 
> > Should we base the indexes on AnsiCompareStr (like TStringList does) or
> > CompareStr by default?
> 
> ? On straight string compare, it should be case sensitive.
> 
> Delphi has the idxCaseInsensitive index option for case insensitive strings, if I'm correct.

This has nothing to do with case-insensitivity. AnsiCompareStr (case
sensitive) and AnsiCompareText (case-insensitive) use the registered
(wide)string manager to compare strings. That mean that on linux, for
example, the results are different when cwstrings is used.

CompareStr (case sensitive) and CompareText (case insensitive) just
perform a binary-compare, which is always the same but doesn't take the
encoding in account...

Joost.





More information about the fpc-pascal mailing list