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
322 stars 120 forks source link

Nonspecified sex should be < instead of X #13

Closed jellevanwezel closed 4 years ago

jellevanwezel commented 4 years ago

According to page 14 of this ICAO document: https://www.icao.int/publications/Documents/9303_p5_cons_en.pdf

Sex in the MRZ can be: M for male,F for female, and < for nonspecified. However, the generator puts in a X for nonspecified instead of a <.

This is correct for the VIZ as can be seen in the same document at page 11. But not for the MRZ.

The document refers to TD1 but it also aplies for the other document types:

Arg0s1080 commented 4 years ago

Hi @jellevanwezel !

Oops! Yes, it's a bug. It seems that I read the "F" note quickly and badly (my English is very bad, although the worst part is that the document is available in my language xD)

As always, thank you very much!

PS: I'll fix it as soon as I can, but have you not thought about creating your own PR?

Arg0s1080 commented 4 years ago

Fixed!

Finally it will work as follows:

Generator:

Chars X, x, < and "" (empty string) returns <, otherwise a SexError will rise

Checker:

Chars M, F or < returns True, False otherwise

Thanks