Why is AnsiSameText not ANSI?

One would think, looking at the name, that AnsiSameText defined in SysUtils (Delphi XE) will receive ANSI strings as parameters, but the function is defined as follows:

function AnsiSameText(const S1, S2: string): Boolean

What am I missing here?
The AnsiStrings module has an ANSI function, but why is it (in Sysutils) called ansi?

+4
source share
1 answer

In older versions of Delphi, pre-Unicode, there were two sets of string comparison functions:

  • SameText, CompareTextetc. They performed comparisons that ignored the locale.
  • AnsiSameText, AnsiCompareTextetc. They performed comparisons that took into account the locale.

Unicode, , string, UTF-16. . SameText , AnsiSameText .

, , Ansi , . , Ansi -Unicode Delphi.

, , , .

+11

Source: https://habr.com/ru/post/1539106/


All Articles