CIF - Country Codes
Mapping the country codes to an application independent code is a real crux:
- PGN is using a mix of IOC country codes and self defined codes. The IOC country codes have changed many times, and not all countries are assigned to a code. And a special problem is that a few historical IOC country codes are clashing, for example the self defined PGN country code "NET" for Internet is clashing with the historical IOC country code "NET" for Netherlands.
-
ChessBase has his own special set of country codes. This application is writing his own country codes when exporting to a PGN file. This is a violation of the PGN standard. Some of the ChessBase country codes are clashing with PGN/FIDE/IOC:
- "CAM": Cameroon in ChessBase, but Cambodia in IOC.
- "FRG": French Guiana in ChessBase, but Federal Republic of Germany in IOC.
- "NET": American Samoa in ChessBase, Internet in PGN, and Netherlands in IOC (1960).
- "NIG": Niger in ChessBase, but Nigeria in PGN.
- "PAL": Palau in ChessBase, but Palestine in PGN.
- "SAL": Solomon Islands in ChessBase, but El Salvador in IOC (1964-76).
- "SVI": Saint Vincent and the Grenadines in ChessBase, but Switzerland in IOC (1956-60).
- "ZAR": Russian Empire in ChessBase, but Zaire in IOC (1974).
The result is that the mapping of the country code cannot garantuee a proper value if the source of the PGN file is unknown.
-
FIDE is in general using the IOC country codes, with one exception:
- "MNC" for Monaco, instead of the IOC code "MON" (possibly the reason is that in year 1968 IOC has used "MON" for Mongolia).
Furthermore FIDE is using some additional self defined codes.
The FIDE country code set is used by the application Chess Assistant.
The application Scid is in general using the FIDE country codes, and some of the IOC/PGN codes for countries not known in the FIDE country list, but with one exception: Instead of "NET" (PGN code) it is using "INT" for Internet (probably to avoid a clash with ChessBase and IOC).
There is a problem with ChessBase and Scid:
-
In ChessBase the user is selecting from a country list which contains the three-letter codes, but no country name information. Because the user does not always know the meaning of the codes some mistakes are always possible.
-
Scid does not provide a list for the country codes, the user is entering the three-letter code by hand. Not only some mistakes are possible, it may happen that the user is entering a code not known in any system.
This is a list of some mistakes done by Scid users:
- "CAM" for Cameroon, but this is the code for Cambodia.
- "TCH" for Czechoslovakia, but this is the code for Czech Republic.
- "KIR" for Kyrgyzstan (Kirgistan in German), but this is the code for Kiribati.
- "LIB" for Libya, but this is the code for Lebanon.
- "MRT" for Mauritania, but this is the code for Mauritius.
- "NIG" for Nigeria, but this is the code for Niger.
- "SWZ" for Switzerland, but this is the code for Swaziland.
- "NET" for Netherlands, but this is the PGN code for Internet.
This is a list of some mistakes often done by ChessBase users:
- "NIG" for Nigeria, but this is the code for Niger.
- "NET" for Netherlands, but in ChessBase this is the code for American Samoa.
- "SVN" for Slovenia, but in ChessBase this is the code for Svalbard.
- "ZAR" for Zaire (former name of Democratic Republic of the Congo), but in ChessBase this is the code for the Russian Empire.
Especially the problem with Scid, the user is allowed to enter an unrecognizable code, requires a special handling: this application will also always export the PGN tags "WhiteCountry" and "BlackCountry" with the user entered codes, in this way it is guaranteed that Scid can read his own export.
Now we come to the mapping of country codes:
For an application independent mapping the numerical ISO 3166-1 code seems to be one of the best choices, although FIPS is also a useful code. But the ISO 3166-1 code is the most stable code, only a very few cancelled codes are reused.
In fact all the standardized country code systems are not sufficient for a complete mapping, because many historical countries and regions has also to be available. So C/CIF is adding an extended range of numerical codes for this purpose. An original ISO 3166-1 value is less than 1000 (in fact less than 900), and the extended codes are all higher or equal to 1000.
The list of country codes is divided into several sections:
-
The actual ISO 3166-1 codes.
-
The NSCC extension of ISO 3166-1 codes. This code is used for Channel Islands. Guernsey and Jersey are separated ballwicks belonging to this archipelago, but some applications like ChessBase do not distinguish between both ballwicks. This code is less than 1000, because it is an officially reserved ISO 3166-1 code.
-
Historical ISO 3166-1 codes: these are the codes for countries or independent regions which are nowadays not independent aynmore.
-
Like the historical codes, but these codes are officially deleted, although still supported by the C/CIF library.
-
Recognized, but not separately listed states: this affects Svalbard and Jan Mayen, for any reason the ISO 3166-1 code table is listing Svalbard and Jan Mayen as one state, but they are not administratively related.
-
Unrecognized countries and regions: these are semiautonomous regions, but by many people seen as a country.
-
Unrecognized regions, especially for FIPS mapping: these regions are listed to support a consistent mapping of the FIPS country codes. Most of these regions are uninhabitated.
-
Stateless: some special codes for sites not related to any country or region.
-
Historical regions: German Empire (1871-1945) and Russian Empire (1721-1917) are listed for ChessBase support. Both codes are quite useful, because some historical games cannot be assigned to any actual country. Australasia and West Indies Federation are listed to support a consistent mapping of the IOC country codes.
-
Historical independent states and regions: those regions were independent only a short time, and will not be used anymore. But some historical games may be assigned to such a historical regions, so it will be supported for completeness.
The handling of the country codes seems to be a complicated thing, but the C/CIF library provides some useful functions for the mapping between different country code systems: ISO 3166-1, ISO 3166-2, ISO 3166-3, FIDE, IOC, PGN, ChessBase, and FIPS. One of the mapping tables, namely the mapping from IOC to ISO 3166-1, is largely extended to recognize some more systems at once (so far as not clashing with IOC codes): ChessBase, ISO 3166-3, FIDE, UN vehicle codes (but only the three-letter codes), some common German codes (e.g. "BRD"), some often seen scrambled codes (e.g. "CRS" for Czech Republic), and some quite common used abbreviations (e.g. "INT" for Internet). With this mapping table (656 entries) it should be possible to map all the country codes used in PGN archives. Furthermore a separate function for the mapping of the codes used in Scid will be provided.