MCPcopy
hub / github.com/django/django / punycode

Function punycode

django/utils/encoding.py:208–210  ·  view source on GitHub ↗

Return the Punycode of the given domain if it's non-ASCII.

(domain)

Source from the content-addressed store, hash-verified

206
207
208def punycode(domain):
209 """Return the Punycode of the given domain if it's non-ASCII."""
210 return domain.encode("idna").decode("ascii")
211
212
213def repercent_broken_unicode(path):

Callers 4

get_fqdnMethod · 0.90
sanitize_addressFunction · 0.90
prep_addressMethod · 0.90

Calls 2

decodeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected