The Turkish İ Problem and Why You Should Care (2012)
Published on: 2025-07-24 12:34:17
Take a look at the following code.
const string input = "interesting" ; bool comparison = input . ToUpper () == "INTERESTING" ; Console . WriteLine ( "These things are equal: " + comparison ); Console . ReadLine ();
Let’s imagine that input is actually user input or some value we get from an API. That’s going to print out These things are equal: True right? Right?!
Well not if you live in Turkey. Or more accurately, not if the current culture of your operating system is tr-TR (which is likely if you live in Turkey).
To prove this to ourselves, let’s force this application to run using the Turkish locale. Here’s the full source code for a console application that does this.
using System ; using System.Globalization ; using System.Threading ; internal class Program { private static void Main ( string [] args ) { Thread . CurrentThread . CurrentCulture = new CultureInfo ( "tr-TR" ); const string input = "interesting" ; bool comparison = input . ToUpper () == "INTERESTING" ; Console .
... Read full article.