0

In my application, some text the user typed in a .txt file is compared with file names and running process names on the users computer.

Should I use Current Culture comparison for such, or is Ordinal comparison fine.

If it matters at all, I'm using c#

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
JackBarn
  • 635
  • 1
  • 6
  • 18

1 Answers1

0

It depends on what you expect. Ordinal comparison literally compares the bits and so ignores aspects like Unicode normalization. Linguistic comparisons use the rules that make sense to users. So for example if you want to use language specific rules of the type where 'æ' is equivalent to 'ae' (English) or 'ß' (sharp s) is equivalent to 'ss' (German) or where 'á' (decomposed: a followed by combining acute) is equivalent to '́á' (precomposed: a with acute) then you will need to use one of the culture comparisons.

Eric MSFT
  • 3,246
  • 1
  • 18
  • 28