Wednesday, 20 July 2011

The Joy of Country Codes

The creation of South Sudan as a distinct national entity implies a huge number of practical problems. Little things like creating a viable government, a functional police force and army, a national infrastructure, and all the rest. For the sake of the people there, who have already suffered much more than enough, I hope that it works, although one newspaper article has already referred to it as a "pre-failed state".

Among all these things, one that has to happen is the creation of country codes which are used for all kinds of things. In particular, there is the two-letter code that appears at the end of a URL (like '.uk'), and the international dialling code. Alphabetic country codes are designated by a standard called ISO 3166, administered by the International Organisation for Standardisation, or ISO for short - the acronym carefully chosen since it is actually not an acronym at all, standing for neither the official French nor English names of the organisation. International dialling codes are designated in a standard called E.164, administered by the International Telecommunications Union (ITU).

The ITU grants an E.164 code to a country within 30 days of it being recognised by the United Nations. These codes are mostly two digits long (e.g. 44, the United Kingdom) or three digits (e.g. 351, Portugal). There are two exceptions: 1 and 7. 1 isn't actually a country code at all, since it designates the geographical area of North America including Canada, the USA, and various Caribbean islands. 7 used to be the USSR. Here be politics. It may seem simple enough to assign codes to countries, but actually it's a political and diplomatic minefield. When the codes were assigned, the Cold War was at its height and the USSR could not accept that the US could have a single digit (even though it didn't) and they didn't. Or so I suppose - I wasn't there, at the meeting of CCITT (former name of ITU-T) Study Group 2 where all this must have been hammered out. So now 7 is Russia, except that it's also used by Kazakhstan, and despite the fact that these two countries between them probably have fewer telephone numbers than some countries with three-digit codes.

Reading lists isn't everybody's cup of tea, but they often contain little gems of curiosity. Anyone who's had to call Taiwan knows that its country code is 886. But you won't find this in E.164. Rather, what you'll find is the entry for China, 86, with a footnote saying "within country code 86, 866 is used to designate the Chinese Province of Taiwan." But don't try dialling 866, because it won't work. Looking further, you'll find an entry for 886 with the text, "886 is reserved for assignment by the United States". In other words, China was not prepared to permit any reference to Taiwan as an independent country (their long standing position) but wasn't going to stand in the way of a practical arrangement that would let everybody get on with things.

Two-letter country codes, which are by far the best known, are in fairly short supply. In theory there are 676 (26*26) of them, but they try to have some mnemonic significance, and for well over 200 countries and other territories this makes it difficult to fit everything. For some reason, 'M' is a very common initial, and nearly all of the m's are used up. When I wanted to add Molvania (along with Elbonia and the Wallis and Grommet Islands) to the list of countries in our in-house database app, the best I could do was MJ. (Incidentally the same is true for state names in the US - M is the most-used first letter of the two-letter state codes). But luckily for South Sudan, even though 'S' is also a common initial, SS is still free. Perfect, n'est-ce pas?

Well, except that "ss" has, ahem, unfortunate connotations. Opinions differ as to whether the ISO Secretariat will allow this or not. And if not, all the other likely possibilities are already taken. About the best that I can think of would be to use a possible French version of the country name, "Sudan Meridional" (a word for "southerly" in French, along with "austral"). That would give SM. Of course that has connotations too, and very favourable they could be too for the fledgling country. Think how much money tiny Tuvalu has made from the happenstance of getting TV. There must surely be any number of kinky websites that would pay for as SM domain name... or there again, maybe the ISO Secretariat wouldn't be too keen on that either.

ISO 3166 is full interesting little tidbits. You know, of course, that FR is France. Well almost. Actually, it's "France including Clipperton Island". Where is that? I hear you ask. You mean you didn't know that it's a (usually) unpopulated atoll in the middle of the Pacific, 1000 kilometres from the nearest other land (Mexico)? And why on earth is it considered to be part of France? Thus begins a lengthy distraction on Wikipedia. Oh, Clipperton Island also has its very own code, CP, although according to Google there is not a single site that uses it.

And you know the code for my country, the United Kingdom of Great Britain and Northern Island (to give it its full title)... everyone knows that it is UK. Well, except it isn't. Actually it's GB. For some reason when they starting assigning URLs they decided to use UK instead. So UK is covered under a handful of oddball codes (along with CP incidentally) with the text "Reserved on request of the United Kingdom lest UK be used for any other country".

ISO 3166 has its share of odd diplomatic compromises and oddities, too. I bet you didn't know that BO is "Bolivia, Plurinational State of".

And you thought all this stuff was easy.

(Update, 16th August: they did get SS, read about it here. And the dialing code is +211.)

No comments: