Closed teebu closed 1 year ago
That is an important consideration if you're building CURPs, but stdnum is a validator.
In that case Ñ
would be in somebodies name (e.g. Enrique Peña Nieto) but once it's converted to a CURP it would be an X so the validator only needs to know how to handle X in a CURP not the conversion of Ñ => X.
For now, I'm closing this since I don't understand the issue you're trying to describe. If I'm misunderstanding please let me know.
Ok, how about the non-binary X for the gender check?
Similar statements would apply. Since the CURP is the encoding of these fields as long as it was originally encoded correctly there should be no issue with validating the CURP.
That said, reviewing the code getGender()
will return the wrong gender for 'X'.
Fixed in #47
Taken from: https://en.wikipedia.org/wiki/Unique_Population_Registry_Code If any step in the above procedure leads to the letter "Ñ" appearing anywhere in the CURP, the "Ñ" is replaced by an "X".
A one-letter gender indicator (H for male (hombre in Spanish), M for female (mujer in Spanish), or X for non-binary); [1]
However, I can't seem to find official documentation for this.