I am trying to compare two lines in OSX in case insensitive mode using AnsiSameText. This works well, but in OSX Yosemite it is strange if OSX's “preferred language” is set to Dutch (“System Preferences” → “Language and Region” → “Preferred Languages”, → “Dutch Dutch”).
In the following code example, I expect it to print only "the same". But I get "the same, different, different."
program Project2; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; begin if AnsiSameText('abcde', 'ABCDE') then // Same WriteLn('Same') else WriteLn('Different'); if AnsiSameText('abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') then // different WriteLn('Same') else WriteLn('Different'); if AnsiSameText('i', 'I') then // different WriteLn('Same') else WriteLn('Different'); end.
What is the correct way to compare case insensitive texts?
I am using Delphi XE7.
source share