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

Roaming the cobblestones of Istanbul

"Inside the church there are still traces of rune inscriptions made during the Viking age by Varangians, an elite guard made up of Scandinavian immigrant warriors."

Roaming through Banff

"Even though the main town is surrounded by mountains with names such as Sulphur Mountain, it is as far away from Mordor as one could imagine."

Alone in Kyoto

"I tried my best to sneak across the building, but the floor revealed me each time. I suppose I would make a lousy ninja."

A journey through Iran

"I woke up freezing on a Persian rug with aching back. Behind a corner I saw the damned rooster that kept me awake during many hours."

Bunker safari

"The area contains 54 excavated bunkers along with gun emplacements, scattered around the town’s most visible landmark."

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."