The Turkish İ Problem and Why You Should Care
Well, this is our world 🙂
Take a look at the following code.
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.
Now we’re seeing this print out These things are equal: False
.
To understand why this is the case, I recommend reading much more detailed treatments of this topic:
The tl;dr summary summary is that the uppercase for i
in English is I
(note the lack of a dot) but in Turkish it’s dotted, İ
. So while we have two i’s (upper and lower), they have four.
this detailed article is published on You’ve Been Haacked, please click for the full version