ISO 5218 (https://standards.iso.org/ittf/PubliclyAvailableStandards/c036266_ISO_IEC_5218_2004(E_F).zip) has a lofty goal. It
specifies a uniform representation of human sexes for the interchange of information
in order to
improve clarity and accuracy of interchange
and
minimize the amount of human intervention required for communicating representation of sexes
To be sure, this is a challenging task! The question of how to describe a person's sex permits all sorts of nuance; while most people either have XY chromosomes and a penis or XX chromosomes and a vagina, there's also intersex people with XXY or some other chromosome combination, XX males, people who've had sex changes, and quite possibly other sorts of weirdness that I don't even know are possible. In certain medical and legal contexts, I can imagine that having a standard by which to communicate this information unambiguously, with all the nuance preserved, would be of great help when building interoperable systems.
How, then, does ISO 5218 propose we deal with all this human diversity? How can these subtleties be encoded?
Like this!
2 Representation of human sexes
Human sex is represented by a one-character numeric code.
The following data elements and codes are used:
Designation - Code
Not known - 0 (zero)
Male - 1 (one)
Female - 2 (two)
Not applicable - 9 (nine)
Well, problem solved!
This is literally the entire technical content of the 24-page spec.
The spec goes on to explain that the choice to have Male before Female was out of respect for the "predominant practices of the countries involved" rather than implying male superiority, and then offers some annexes in which it translates "male" and "female" into an arbitrary subset of human languages and then does the same thing but in XML.