On Sat, March 5, 2016 23:51, Bart wrote: > On 3/5/16, Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > >> One probably includes cwstring, while the other one doesn't. >> AnsiCompareStr can be intercepted/replaced by widestring manages such as >> cwstring. > > Sample from above on Linux 32-bit: > [bart@localhost ConsoleProjecten]$ ./test > AnsiCompareStr('C-C','C=C') = -16 > > Same program, but now added cwstring to uses clause: > > [bart@localhost ConsoleProjecten]$ ./test > AnsiCompareStr('C-C','C=C') = 28
Note that there may be a difference not only between the fallback implementation and a real WideString / UnicodeString manager, but also between WideString / UnicodeString managers used on different platforms - as an example, we cannot guarantee that the results are exactly the same on MS Windows (using its default Unicode string handling routines), Linux with cwstring (depending on the iconv library), AIX with the IBM implementation of iconv and OS/2 with yet another IBM implementation of Unicode string handling routines. If you want to ensure that the behaviour is exactly the same even for various symbols, you should probably use fpwidestring - this results in bigger binaries, but the same code is used across all supported platforms. Tomas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal