tag:blogger.com,1999:blog-6800934446457898793.post8965677146335650748..comments2008-04-22T02:51:20.817-04:00Comments on Moserware: Does Your Code Pass The Turkey Test?Jeff Moserhttp://www.blogger.com/profile/16074905903060665396noreply@blogger.comBlogger37125tag:blogger.com,1999:blog-6800934446457898793.post-69012678504502073972008-04-22T02:51:00.000-04:002008-04-22T02:51:00.000-04:00good job, this really makes sensegood job, this really makes senseAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-58023526235453863772008-04-08T23:24:00.000-04:002008-04-08T23:24:00.000-04:00mert sakayra: interesting to hear about Flex. You'...mert sakayra: interesting to hear about Flex. You're right about it being not just Turkey. The idea is to think about many different locales, but Turkey does seem to highlight a lot of the issues itself. <BR/><BR/>peshir: Yeah, names are tough. Thanks for the info.<BR/><BR/>superjason: Agreed.Jeff Moserhttp://www.blogger.com/profile/16074905903060665396noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-23327347107444810952008-04-08T10:46:00.000-04:002008-04-08T10:46:00.000-04:00Where I used to work, we always did QA on a German...Where I used to work, we always did QA on a German OS, and a Chinese OS. It's amazing how much you learn by doing that. Chinese is particularly difficult because it's double byte.<BR/><BR/>The biggest thing that people had to learn, was to always keep everything binary. Only when accepting input or displaying something do you turn it into human readable format.<BR/><BR/>--SuperJason (<A HREF="http://www.ytechie.com" REL="nofollow">blog</A>)SuperJasonhttp://www.blogger.com/profile/13544562404044466305noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-48620964950642285712008-04-08T10:00:00.000-04:002008-04-08T10:00:00.000-04:00In Holland we use a date format of dd-mm-yyyy and ...In Holland we use a date format of dd-mm-yyyy and have things like IJ and ij ligatures which could mess up your Unicode characters.<BR/><BR/>Something I have not seen mentioned here are assumptions on other culture specific things, like when concerning yourself with names. In Holland someone named "Jan van Dam" would have a first name "Jan" and last name "van Dam" but in a "LastName, FirstName" list would have to be sorted as "van Dam, Jan" under the letter D... ;-)peSHIrhttp://peshir.spaces.live.com/noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-45916908317319026832008-03-31T01:33:00.000-04:002008-03-31T01:33:00.000-04:00The main issue of the "Turkey" test is the "I" and...The main issue of the "Turkey" test is the "I" and "i" problem ("i" is not lowercase of "I" and vice versa). This is specific to Turkish language. The other problems are specific to more then one countries. There are lots of countries that uses "DD/MM/YYYY" or "DD.MM.YYYY" format. <BR/><BR/>Until the first release of .Net, Turkish "I" problem could not be solved in Microsoft technologies, and programmers had to do some hardcoding for that problem which led the application to be very specific to Turkey.<BR/><BR/>There are many other server and development applications that don't work on computers with Turkish region settings. As far as I know Adobe Flex that runs on Eclipse is one of them. When you start coding mxml it has a "Script" tag and the "i" in tag causes compiler error. <BR/><BR/>I recommend setting your region to Turkey and using "I", "İ", "ı" and "i" everywhere (comments, strings, variable-names etc.) then testing your compiler/environment...<BR/><BR/>If you are developing international applications and Turkey is one of your targets, be prepared for problems...<BR/><BR/>One more thing Turkey is in a very strange location, so you have to consider the language problems for Greece, Russia (by the sea), Bulgaria, Armenia, Georgia as well as arabic spoken languages (Syria, Iran and Iraq has borders with Turkey), when you say "Turkey and nearby".<BR/><BR/>So if you expand your territory to Turkey and nearby region, you'll probably will have to solve all regional issues other than Far East (and may be India region) issues. <BR/><BR/>"I" and "i" problem is unique to Turkish.Mert Sakaryahttp://www.blogger.com/profile/08840937717597592297noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-34060821184280047062008-03-17T12:29:00.000-04:002008-03-17T12:29:00.000-04:00German use the same date and currency format. The ...German use the same date and currency format. The 3. and 4. problems are really crazy ^^)stanleyxuhttp://www.blogger.com/profile/12291786770395325696noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-65472236832205715852008-03-16T21:32:00.000-04:002008-03-16T21:32:00.000-04:00Clifton: I can see your point to a degree. The exa...Clifton: I can see your point to a degree. The examples were primarily focused on classic cases where seemingly innocent lines of code can get you in trouble. While looking a bit contrived, they do tend to show up in production code. But you're right, it makes sense to use ISO standards whenever possible. Especially for clear things like XML formatting standards that build on ISO ones. There will still be times where you might look for a configuration file string literal. In this case, it becomes important to not get hit with culture issues.<BR/><BR/>The whole point of the article is to make sure you're aware of the issue. That in itself is a huge step towards getting things to work right.Jeff Moserhttp://www.blogger.com/profile/16074905903060665396noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-53246421581370135032008-03-16T05:19:00.000-04:002008-03-16T05:19:00.000-04:00@David Nelson -Not at all. For me (in NZ), today i...@David Nelson -<BR/><BR/>Not at all. For me (in NZ), today is the 16th of March. Not March 16th. Although I think that varies as much from person to person as it does culturally...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-40554401676137477082008-03-15T06:22:00.000-04:002008-03-15T06:22:00.000-04:00Got here from Scoble! I'm a web/software developer...Got here from Scoble! <BR/><BR/>I'm a web/software developer in the UK. I used to work for a large multinational with sites in both the UK and the US. Whilst the problem of date formatting etc did come up, I solved it by adhering to the standards set by the ISO, which is what I guess I'd urge anyone to do. After all, what use is a standard if no one uses it? <BR/><BR/>I let users know how to enter data in the application by adding appropriate labels to text boxes (e.g. "Date (YYYY/MM/DD)"). This seemed to work quite well but then I never had to deal with anyone in Turkey!<BR/><BR/>RRich Mhttp://www.blogger.com/profile/07422983248182456125noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-4647439896665708312008-03-14T21:59:00.000-04:002008-03-14T21:59:00.000-04:00Aren't most of your examples showing exactly the w...Aren't most of your examples showing exactly the <B>wrong</B> way to fix it? <BR/><BR/>Your suggestions address what would be needed to make the application work for an American who happens to be living in some other country and running your software on the operating system version for that country. It would absolutely not work the way most people in that country would want!<BR/><BR/>For example, your proposed code ensures that wherever in the world someone uses your application, it will require them to input dates in American format, enter numeric values like Americans, and so on. The problem is that if a Turkish, English, or German customer enters the date "07.04.2008", you can be virtually certain they want it to be treated as April 7, 2008; if a Turk (or Frenchman) enters "0,50" for the percentage discount, you can be virtually certain they want to give a 1/2 percent discount, not a 50% discount.<BR/><BR/>Instead, shouldn't you be showing examples of how to change your displays and input validation code to match the local culture? Then you will have a usefully internationalized application.Cliftonhttp://www.blogger.com/profile/08380344880893899902noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-54523668241677567462008-03-14T05:42:00.000-04:002008-03-14T05:42:00.000-04:00Rainer said "By the way we had no problems with Y2...Rainer said "By the way we had no problems with Y2k at all".<BR/><BR/>No, we had problems with "day ten thousand" causing havoc on alpha-sorted indexes 4.5 years earlier instead. So don't go making out it is perfect :-)Peter Morrishttp://www.blogger.com/profile/09377536995235480828noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-64873116084900221672008-03-13T18:56:00.000-04:002008-03-13T18:56:00.000-04:00Since everyone likes bashing the "American" date f...Since everyone likes bashing the "American" date format (MM/DD/YYYY), I would just like to point out that it does have a good reason for existing: it mirrors the way most Americans (and most English speakers as far as I know) pronounce dates aloud, e.g. "March Thirteenth, Two Thousand [and] Eight". Since all such formats have to be interpreted relative to pre-conceived ideas, I don't think that format is any less valid than any other. That said, it is terrible for sorting, which is the only reason that I typically don't use it.David Nelsonwww.commongenius.comnoreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-90396829067013037542008-02-22T04:21:00.000-05:002008-02-22T04:21:00.000-05:00It would be worth noting that all those cases ment...It would be worth noting that all those cases mentioned above are also valid for other Turkic people using latin alphabet like Azerbaijanis Uyghurs, Tatars etc... (see http://en.wikipedia.org/wiki/Uniform_Turkic_Alphabet)<BR/><BR/>Great and informative article, right in spot. Thanks!amiroffhttp://amiroff.myopenid.com/noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-66789128184149223822008-02-21T18:50:00.000-05:002008-02-21T18:50:00.000-05:00You need to email me or something. Try my work em...You need to email me or something. Try my work email, my middle initial is C.Mike Petryhttp://www.blogger.com/profile/00900707625184132791noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-1086579174796499712008-02-19T15:13:00.000-05:002008-02-19T15:13:00.000-05:00thanksthanksOmurhttp://www.blogger.com/profile/17054475722970792443noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-22729089912367736312008-02-18T07:57:00.000-05:002008-02-18T07:57:00.000-05:00Niki: Thanks for the CultureInfo.TextInfo.ListSepa...Niki: Thanks for the CultureInfo.TextInfo.ListSeparator tip. I didn't know about that member.<BR/><BR/>Thanks for the concerns about digits in Turkey. As mentioned above in a comment, I qualified the post as "in or around" Turkey since you're absolutely right that most Turkish people use [0-9]. <BR/><BR/>I tried to pick a locale that would highlight a lot of unexpected results and had to stretch it for Turkey for digits.<BR/><BR/>Again, the overarching theme that I wanted people to take away was the concept of Turkey as a "Sintra Test" in the sense that if you work hard to make your code work well in Turkey by using the best practices outlined in the string paper, your code will probably work anywhere.Jeff Moserhttp://www.blogger.com/profile/16074905903060665396noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-90113675271760143062008-02-18T07:44:00.000-05:002008-02-18T07:44:00.000-05:002 comments:1) Only 10 digits used in Turkey, so a ...2 comments:<BR/>1) Only 10 digits used in Turkey, so a regex for [0-9] is sufficient. Perhaps you should've done a bit more research about Turkey and what's used there before naming the test as "the Turkey test". I understand that you're trying to make a point in locale problems but I guess you can name it differently (locale test... middle east test.. eastern europe test w/ Arabic numbers.. etc.)<BR/><BR/>2)<BR/><A HREF="http://www.lonelyplanet.com/maps/europe/turkey" REL="nofollow"/> for the ignorant ones.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-8588101050349488972008-02-17T18:54:00.000-05:002008-02-17T18:54:00.000-05:00This might be also called the Polish test with pun...This might be also called the Polish test with pun intended. We Poles write dates just like Turkish people. DD.MM.YYYY.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-33086433811952490992008-02-17T08:03:00.000-05:002008-02-17T08:03:00.000-05:00MM/DD/YYYY format is misleading and counter-intuit...MM/DD/YYYY format is misleading and counter-intuitive, abondon on it :) http://en.wikipedia.org/wiki/ISO_8601 defines YYYY-MM-DD which I preferAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-4835383516904807132008-02-17T04:29:00.000-05:002008-02-17T04:29:00.000-05:00I personally use for dates the number of days sinc...I personally use for dates the number of days since the 1 JAN 1968, as in the Pick/Universe world for the internal representation of dates. Makes it easy to calculate 30 or 90 days off a certain date for compares and can be easily converted into any local external date format. Today is day 14658. By the way we had no problems with Y2k at all.Rainerhttp://www.blogger.com/profile/17924712724485080578noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-82543500740367225842008-02-17T00:09:00.000-05:002008-02-17T00:09:00.000-05:00Turkey.<A HREF="http://www.eka.com/Eka06/Images/Locations/WorldMap_North%20America.gif" REL="nofollow">Turkey</A>.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-24529138169966999812008-02-16T17:47:00.000-05:002008-02-16T17:47:00.000-05:00Great Post! A little not-so-well-known addition: I...Great Post! A little not-so-well-known addition: If you parse CSV (comma-separated-values) files, don't assume they're actually separated by commas. In a German locale, for example, they're separated by semicolons. Use CultureInfo.TextInfo.ListSeparator instead of ','.Nikinoreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-66401673259322607102008-02-16T14:44:00.000-05:002008-02-16T14:44:00.000-05:00I agree with using standard formats for dates. I'd...I agree with using standard formats for dates. I'd probably use the XML date format so that it's absolutely ambiguous. <BR/><BR/>Dates are just one thing. With things like string comparisons, it's not intuitive to a guy coming out of college in most places. <BR/><BR/>As the referenced paper mentions, checking URIs for the "file" protocol(knowingly or unknowingly) using a culture sensitive comparer could be dangerous due to the "Turkish I" issue. <BR/><BR/>I guess the overarching theme I was going for, and I still stand by it, is that you have to think about the globalization impacts of your code. It's hard to abstract away if your code is to correctly operate around the world.Jeff Moserhttp://www.blogger.com/profile/16074905903060665396noreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-92220463843212591632008-02-16T14:42:00.000-05:002008-02-16T14:42:00.000-05:00Oh and btw, "arabic numbers" is a misnomer. The nu...Oh and btw, "arabic numbers" is a misnomer. The numbers are Hindu, not arabic. Zero, like the "arabic" numerals, is not arabic at all, but Hindu in origin (it originated in India, in present-day pakistan, before it became islamic, arabic is a double misnomer since they associate themselves as both a religion and an ethnic group, neither of which had anything to do with the idea of Hindu numbers, Hinduism, on the other hand, relates to both the ideology and the ethnicity of the people who came up with the numbers, and the zero)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6800934446457898793.post-52277336350972044802008-02-16T14:36:00.000-05:002008-02-16T14:36:00.000-05:00For the love of *insert favorite love*, don't do t...For the love of *insert favorite love*, don't do this. What this code will do concretely is make your application behave DIFFERENTLY IN DIFFERENT LOCATIONS AROUND THE GLOBE. <BR/><BR/>Just use the ISO standard, and assume people know the standard.<BR/><BR/>Because suppose you get a ticket reservation system in this way. It has servers in, say Europe and in America. One is the fallback for the other.<BR/><BR/>You travel on 4/7/2008, or, if the European server was down at the time of email, something you won't know and have no control over, on 7/4/2008.<BR/><BR/>Better hope you have a damn broad ping utility standing by for scanning your emails.Anonymousnoreply@blogger.com