2 ms·
Lower case is locale-sensitive, however. For example, tolower('I') in Turkish should be 'ı'. And within unicode, doing it in a "dumb ascii" way probably needs
by asveikau 4y ago
Lower case is locale-sensitive, however. For example, tolower('I') in Turkish should be 'ı'.
And within unicode, doing it in a "dumb ascii" way probably needs some normalization of diacritics. Eg. 'é' should be U+0065 U+0301 ("e\xcc\x81"), not U+00E9 ("\xc3\x89").
Not sure how punycode handles this, I did once look deeply into it but that was years ago.
- lifthrasiir 4y agoPunycode normalizes the case and other Unicode stuffs with the PRECIS Framework [1] before the label ever gets encoded to an ASCII-Compatible Encoding---those get prefixed with `xn--`. The root zone and top-level domains have an additional set of script-specific restrictions as well (RZ-LGR [2] in particular). [1] https://datatracker.ietf.org/doc/html/rfc7564 https://datatracker.ietf.org/doc/html/rfc7564 [2] https://www.icann.org/resources/pages/root-zone-lgr-2015-06-21-en https://www.icann.org/resources/pages/root-zone-lgr-2015-06-...