Click here to Skip to main content
15,881,380 members
Articles / Programming Languages / C#
Technical Blog

Is Turkish the only locale with unusual capitalization?

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
30 Dec 2012Apache1 min read 9.9K   1   5
Is Turkish the only locale with unusual capitalization?

It is well known in some circles that Turkish locale has unusual capitalization rules that may break otherwise solid code (e.g. see here: “Turkish Java Needs Special Brewing“).

In a nutshell, we take it for granted that upper case of “i” is “I”, and lower case of “I” is “i”. This is not true in Turkish where upper case of i is dotted İ, and lower case of I is dotless ı. This may have looked like a clever idea in the 1920s, but it sometimes causes a lot of grief in the 21st century.

I was wondering: is Turkish the only locale that has “strange” capitalization rules?

To answer this, first let’s define what is “normal”. As code, unless specifically localized, mostly deals with 26 letters of the Latin alphabet, I define “normal” as

"abcdefghijklmnopqrstuvwxyz".ToUpper().Equals("ABCDEFGHIJKLMNOPQRSTUVWXYZ") &&<br />
"ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToLower().Equals("abcdefghijklmnopqrstuvwxyz")

I wrote a little program in C# that does the “normality” test for each culture defined in the system. It turns out that on my machine out of 354 defined cultures the following exhibit unusual behavior:

az, az-Latn, az-Latn-AZ, tr, tr-TR

All of them are varieties of Turkish and Azerbaijani locales, and the anomaly is limited to the i/I pair. Azerbaijan used Cyrillic script until independence from the Soviet Union, and then in 1991 switched to a slightly extended version of the Turkish alphabet, inheriting the i/I anomaly.

This article was originally posted at http://www.ikriv.com/blog?p=1163

License

This article, along with any associated source code and files, is licensed under The Apache License, Version 2.0


Written By
Technical Lead Thomson Reuters
United States United States
Ivan is a hands-on software architect/technical lead working for Thomson Reuters in the New York City area. At present I am mostly building complex multi-threaded WPF application for the financial sector, but I am also interested in cloud computing, web development, mobile development, etc.

Please visit my web site: www.ikriv.com.

Comments and Discussions

 
QuestionInteresting... Pin
Johnny J.7-Jan-13 21:49
professionalJohnny J.7-Jan-13 21:49 
I've never though of that, and I certainly didn't realise it was such a dangerous problem... OMG | :OMG:

I especially liked this comment in your link:

Alternatively, the press could ask for banning knives from the homes of demonstrably stupid people

Laugh | :laugh:
Why can't I be applicable like John? - Me, April 2011
-----
Beidh ceol, caint agus craic againn - Seán Bán Breathnach
-----
Da mihi sis crustum Etruscum cum omnibus in eo!
-----
Just because a thing is new don’t mean that it’s better - Will Rogers, September 4, 1932

QuestionSome more Pin
Mihai Nita30-Dec-12 11:18
Mihai Nita30-Dec-12 11:18 
AnswerRe: Some more Pin
Ivan Krivyakov30-Dec-12 15:29
Ivan Krivyakov30-Dec-12 15:29 
GeneralRe: Some more Pin
bitterskittles9-Jan-13 4:42
bitterskittles9-Jan-13 4:42 
GeneralMy vote of 5 Pin
ozkan.pakdil30-Dec-12 9:46
ozkan.pakdil30-Dec-12 9:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.