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

Aliens in Nevada and New Mexico

"We turned around and went down another dirt road, past countless Joshua trees until our car was covered in dirt and we finally arrived at the Front Gate of Area 51."

Visions of Singapore

"By extensive use of landfill with sand bought from Indonesia and Cambodia, the bay area has expanded greatly in the last few years and tall buildings pop up everywhere."

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

Memories of Skye

"The countryside is charming and some places even have coffee."

The urban maze of Tangier

"There are exciting things waiting around every corner and my bucket list is long, but the Medina has a mindset of its own regarding time and space."

The streets of Paris

"One of the advantages of repeated visits to a place is the leisure pace of awe and discovery while drifting slowly down the worn streets of the French capital."

Instagram