java.lang.Object | |
↳ | java.net.IDN |
Converts internationalized domain names between Unicode and the ASCII Compatible Encoding (ACE) representation.
See RFC 3490 for full details.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ALLOW_UNASSIGNED | When set, allows IDN to process unassigned unicode points. | |||||||||
int | USE_STD3_ASCII_RULES | When set, ASCII strings are checked against RFC 1122 & RFC 1123. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Equivalent to
toASCII(input, 0) . | |||||||||||
Transform a Unicode String to ASCII Compatible Encoding String according
to the algorithm defined in RFC 3490.
| |||||||||||
Translates a string from ASCII Compatible Encoding (ACE) to Unicode
according to the algorithm defined in RFC 3490.
| |||||||||||
Equivalent to
toUnicode(input, 0) . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
When set, allows IDN to process unassigned unicode points.
When set, ASCII strings are checked against RFC 1122 & RFC 1123.
Equivalent to toASCII(input, 0)
.
input | the Unicode name |
---|
IllegalArgumentException | if input does not conform to RFC 3490
|
---|
Transform a Unicode String to ASCII Compatible Encoding String according to the algorithm defined in RFC 3490.
If the transformation fails (because the input is not a valid IDN), an exception will be thrown.
This method can handle either an individual label or an entire domain name. In the latter case, the separators are: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), and U+FF61 (halfwidth ideographic full stop). All of these will become U+002E (full stop) in the result.
input | the Unicode name |
---|---|
flags | 0, ALLOW_UNASSIGNED , USE_STD3_ASCII_RULES ,
or ALLOW_UNASSIGNED | USE_STD3_ASCII_RULES |
IllegalArgumentException | if input does not conform to RFC 3490
|
---|
Translates a string from ASCII Compatible Encoding (ACE) to Unicode according to the algorithm defined in RFC 3490.
Unlike toASCII
, this transformation cannot fail.
This method can handle either an individual label or an entire domain name. In the latter case, the separators are: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), and U+FF61 (halfwidth ideographic full stop).
input | the ACE name |
---|---|
flags | 0, ALLOW_UNASSIGNED , USE_STD3_ASCII_RULES ,
or ALLOW_UNASSIGNED | USE_STD3_ASCII_RULES
|
Equivalent to toUnicode(input, 0)
.
input | the ACE name |
---|