Package google.registry.util
Class Idn
java.lang.Object
google.registry.util.Idn
A partial API-compatible replacement for
IDN
that replaces IDNA2003 processing with UTS46 transitional processing, with differences as
described in the UTS46
documentation/
This class provides methods to convert internationalized domain names (IDNs) between Unicode
and ASCII-only Punycode form. It implements the
parts of the API from IDN
that we care about, but will return different results
as defined by the differences between IDNA2003 and transitional UTS46.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Translates a string from Unicode to ASCII Compatible Encoding (ACE), as defined by the ToASCII operation of RFC 3490.static String
Translates a string from ASCII Compatible Encoding (ACE) to Unicode, as defined by the ToUnicode operation of RFC 3490.
-
Constructor Details
-
Idn
public Idn()
-
-
Method Details
-
toASCII
Translates a string from Unicode to ASCII Compatible Encoding (ACE), as defined by the ToASCII operation of RFC 3490.This method always uses UTS46 transitional processing.
- Parameters:
name
- a domain name, which may include multiple labels separated by dots- Throws:
IllegalArgumentException
- if the input string doesn't conform to RFC 3490 specification- See Also:
-
toUnicode
Translates a string from ASCII Compatible Encoding (ACE) to Unicode, as defined by the ToUnicode operation of RFC 3490.This method always uses UTS46 transitional processing.
ToUnicode never fails. In case of any error, the input string is returned unmodified.
- Parameters:
name
- a domain name, which may include multiple labels separated by dots- See Also:
-