Arg0s1080 / mrz

Machine Readable Zone generator and checker for official travel documents sizes 1, 2, 3, MRVA and MRVB (Passports, Visas, national id cards and other travel documents)
GNU General Public License v3.0
328 stars 122 forks source link

Germany is denoted by 1 letter #11

Closed jellevanwezel closed 4 years ago

jellevanwezel commented 4 years ago

In the list of countries (mrz/base/countries), all countries are denoted with 3 letters except Germany which is denoted with the single letter D while acording to: ISO_3166-1 it should be DEU

Arg0s1080 commented 4 years ago

Yes, it's correct.

Germany (Deutchland) is an exception according to ICAO documentation (page 24).

You can check it yourself by searching Google images

Eg: image image

jellevanwezel commented 4 years ago

The thing is that the documentation is confusing now, because it says it expects 3 letters while in reality only for Germany it wants 1 letter.

class TD3CodeGenerator(_Fields, _TD3HashGenerator, _TD3HolderName):
    """Calculate the string code of the machine readable zone for official travel documents of size 3 (passports)

    Params:
        document_type    (str):  Normally 'P' for passport
    --> country_code     (str):  3 letters code (ISO 3166-1) or country name (in English)
        surname          (str):  Primary identifier(s)
        given_names      (str):  Secondary identifier(s)
        document_number  (str):  Document number
        nationality      (str):  3 letters code (ISO 3166-1) or country name
        birth_date       (str):  YYMMDD
        sex              (str):  Genre. Male: 'M', Female: 'F' or Undefined 'X'
        expiry_date      (str):  YYMMDD
        optional data    (str):  Personal number. In some countries non-mandatory field. Empty string by default
        transliteration (dict):  Transliteration dictionary for non-ascii chars. Latin based by default
        force           (bool):  Disables checks for country, nationality and document_type fields.
                                 Allows to use 3-letter-codes not included in the countries dictionary
                                 and to use document_type codes without restrictions.

    """
Arg0s1080 commented 4 years ago

ICAO doc:

CODES FOR NATIONALITY, PLACE OF BIRTH, LOCATION OF ISSUING STATE/AUTHORITY AND OTHER PURPOSES Part A — Letter Codes The following are the two- and three-letter codes for entities specified and regularly updated in [ISO 3166-1], with extensions for certain States and organizations being identified by an asterisk. The current version of the codes may be obtained from the [ISO 3166] maintenance agency - [ISO 3166/MA], ISO’s focal point for country codes.

Then we will have to complain to ICAO :)

It's just an exception, my friend... just that (like United Kingdom "GB")

Regards!

jellevanwezel commented 4 years ago

Oke, I won't further press the issue. Thanks for responding!