[fpc-pascal] AnsiCompareStr question (again...)

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Mar 5 20:57:57 CET 2016


On 05/03/16 20:27, Marcou Gilles wrote:
> this is strange. Using you example I got the value -16. I am using fpc
> 2.6.4 on a Linux 64 bits machine. I do not get why I got a different
> value than you. And in my case, the strange behavior is that
> AnsiCompareStr in the same unit but in two different application gave
> two different results. I wonder if somebody else got observed this?

One probably includes cwstring, while the other one doesn't. 
AnsiCompareStr can be intercepted/replaced by widestring manages such as 
cwstring.

The default implementation of AnsiCompareStr just compares based on 
ASCII values. cwstring also takes the locale into account.


Jonas



More information about the fpc-pascal mailing list