Friday, August 27, 2010

ASP.NET, databases, localization and the problem with Turkish...

This is one of the craziest problems ever:

1. You have a database field called 'CustomerId'
2. so you refer to this field as myrow("CustomerId")
3. this works for all users worldwide but fails for Turkish users
4. change the code to refer to myrow("Customerid") and it works

Reason:  Turkish has an i character without a dot.

So, in Turkish, 'i' and 'I' are not related in any way: they are not upper and lower case versions of the same character, but completely different characters.  There's a capital 'i' with a dot above it that is the upper case version of 'i' (with a dot).  Of course, 'I' without the dot is the upper case version of i without the dot. Clear?

When you switch on localization support in ASP.NET, this doesn't just affect the things that the user sees in their browser depending on the language settings, it also affects your programming!


Rick Strahl found this same issue back in 2005: http://www.west-wind.com/weblog/posts/2204.aspx

No comments:

Post a Comment