
{"id":1163,"date":"2012-12-26T18:26:15","date_gmt":"2012-12-26T23:26:15","guid":{"rendered":"http:\/\/www.ikriv.com\/blog\/?p=1163"},"modified":"2012-12-26T18:26:15","modified_gmt":"2012-12-26T23:26:15","slug":"is-turkish-the-only-locale-with-unusual-capitalization","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=1163","title":{"rendered":"Is Turkish the only locale with unusual capitalization?"},"content":{"rendered":"<p>It is well known in some circles that Turkish locale has unusual capitalization rules that may break otherwise solid code (e.g. see here: &#8220;<a href=\"http:\/\/java.sys-con.com\/node\/46241\">Turkish Java Needs Special Brewing<\/a>&#8220;).<\/p>\n<p>In a nutshell, we take it for granted that upper case of &#8220;i&#8221; is &#8220;I&#8221;, and lower case of &#8220;I&#8221; is &#8220;i&#8221;. This is not true in Turkish where upper case of i is dotted \u0130, and lower case of I is dotless \u0131. This may have looked like a clever idea in the 1920s, but it sometimes <a href=\"http:\/\/gizmodo.com\/382026\/a-cellphones-missing-dot-kills-two-people-puts-three-more-in-jail\">causes a lot of grief<\/a> in the 21st century.<\/p>\n<p>I was wondering: is Turkish the only locale that has &#8220;strange&#8221; capitalization rules?<\/p>\n<p>To answer this, first let&#8217;s define what is &#8220;normal&#8221;. As code, unless specifically localized, mostly deals with 26 letters of the Latin alphabet, I define &#8220;normal&#8221; as<\/p>\n<p><code>\"abcdefghijklmnopqrstuvwxyz\".ToUpper().Equals(\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\") &&<br \/>\n\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".ToLower().Equals(\"abcdefghijklmnopqrstuvwxyz\")<\/code><\/p>\n<p>I wrote <a href=\"http:\/\/www.ikriv.com\/dev\/dotnet\/LatinCapitalization.cs\">a little program in C#<\/a> that does the &#8220;normality&#8221; 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:<\/p>\n<p><code>az, az-Latn, az-Latn-AZ, tr, tr-TR<\/code><\/p>\n<p>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.<a style=\"display:none\" href=\"http:\/\/www.codeproject.com\/script\/Articles\/BlogFeedList.aspx?amid=1181663\" rel=\"tag\">CodeProject<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is well known in some circles that Turkish locale has unusual capitalization rules that may break otherwise solid code (e.g. see here: &#8220;Turkish Java Needs Special Brewing&#8220;). In a <a href=\"https:\/\/ikriv.com\/blog\/?p=1163\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[3,16,4],"tags":[],"class_list":["entry","author-ikriv","post-1163","post","type-post","status-publish","format-standard","category-dotnet","category-demos","category-hack"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1163"}],"version-history":[{"count":0,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1163\/revisions"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}