Mink Machine

Turkish culture issues in .NET

I came across a very fishy bug which seemed to occur only for Turkish locales. 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”.

As soon as I had regrown all the hair I previously ripped off in utter frustration, I found the bug quite fascinating. To avoid the problem, you might try something like this:

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

Sure, software development is supposed to be hard and all, but these kinds of weird bugs are just insane. 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.

Post a comment

Your email address will not be published. Required fields are marked *

Featured stories

Greetings from Moldova

Greetings from Moldova

"But Chisinau is an unexpected gem in the wilderness. Even though Moldova is one of the poorest countries in Europe, the capital has its fair share of impressive buildings and post-Soviet architecture."
I still love you, New York

I still love you, New York

"Now I’m back and our roles are somewhat reversed. Like River Song and the Doctor, we meet again under different circumstances."
New Years Eve in Sydney

New Years Eve in Sydney

"Opera House is seen in front of the massive fireworks in the harbor area, celebrating the 75th anniversary of the Harbour Bridge."
Good morning Montenegro

Good morning Montenegro

"One would almost think that all this secrecy was made on purpose to keep the hordes of tourists away. Let them all perish in the crowds of Dubrovnik while the people of Montenegro can enjoy their beautiful country on their own. Or something like that."
Sessions in Seville

Sessions in Seville

"I end my journey in front of the tomb of Columbus, located inside the world’s largest Gothic cathedral."
The sound of Salzburg

The sound of Salzburg

"It is based on the true story of Maria von Trapp, even though I suspect she didn’t go singing alone in the mountain ranges."

Instagram

Seville
Venice
Gothenburg
Fever Ray
Rome
Basel
Singapore
Kuala Lumpur