What About Native Code?

It is possible to introduce this sort of error in native code, as well. This is much less common, for the following reasons:

  1. Many casing and comparison routines used in native code are ordinal routines that are part of runtime libraries and do not exhibit any variation.
  2. There are some Win32 APIs that do exhibit variation, such as CompareString; however, they force you to pass in the culture to use as a parameter, so it is harder to make the same mistake.
  3. The .NET Framework is the first API library to handle Turkish I comparisons in a linguistically correct way. Previously, only the two-letter casing variations and the sorting variations were different, and these are much harder to hit in real code.

No comments:

Post a Comment