I came across a very fishy bug which seemed to occur only for Turkish locales in Windows. It turned out that case sensitivity was the culprit and both Rick Strahl and Scott Hanselman had written about the issue a few months ago. The Turkish alphabet seems to have different meanings for upper and lower case versions of the letter “I”.

To avoid the problem in C#, you might try something like this:

myString.ToLower(System.Globalization.CultureInfo.InvariantCulture)

If you’re feeling adventurous, switch your browser to Turkish and see what happens with your code. You might not like the result but it sure is an eye-opener on the importance of software internationalization and the need for defensive coding.

Comments

No comments yet.

Leave a reply