|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.vgrs.xcode.idna.Idna
public final class Idna
Implementation of IDNA2008 Protocol
Ultimately the following will be true:
The Race object uses Utf16 as input and output
The Punycode object uses Unicode as input and output
toAscii
1. Application has Unicode data U32
2. Pass the Unicode data to Idna U32
3. Idna tokenizes the data. *U32
4. Idna runs Unicode through IDNA2008 Protocol if the registration protocol
is specified. U32
5. Idna encodes the data using an ACE algorithm U32->U16
6. Idna assembles the labels. U16
7. Idna passes the Utf16 back to the application. U16
- It is not trivial to tokenize the labels as Unicode. We have written
a special object to do so, which allows us to avoid decoding to and
from Unicode just for tokenization.
toUnicode
1. Application has Utf16 (probably Ascii) string U16
2. Pass the Utf16 data to Idna. U16
3. Idna tokenizes the data. U16
4. Idna encodes the data in Unicode. U32 <-U16
5. Idna runs Unicode through IDNA2008 Protocol if the registration protocol
is specified.
6. Idna decodes the data to Utf-16. U32->U16
7. Idna decodes the data using an ACE algorithm U32 <-U16
8. Idna assembles the labels *U32
9. Idna asserts IDNA2008 Bidi rules if an RTL label is present in the domain
if the registration protocol is specified
10. Idna passes the Unicode back to the application. U32
| Field Summary | |
|---|---|
static char |
ACE_DELIMITER
Stores the Unicode character used to delimit domain labels in an ASCII Compatible Encoding sequence. |
static boolean |
DEFAULT_REGISTRATION_PROTOCOL
Indicates whether or not IDNA2008 Protocol rules are applied. |
static boolean |
DEFAULT_TO_UNICODE_EXCEPTION_FLAG
Indicates whether or not to throw XcodeExceptions from the toUnicode method. |
static java.lang.String |
DELIMITERS
Stores the list of IDNA compliant delimiters. |
static int[] |
INT_DELIMITERS
Stores the list of IDNA compliant delimiters. |
static int |
MAX_DOMAIN_LABEL_LENGTH_IN_OCTETS
RFC 1034 imposes a length restriction of 0 to 63 octets per domain label. |
| Constructor Summary | |
|---|---|
Idna(Ace ace)
Construct an Idna object for converting data to and from an ASCII compatible form. |
|
Idna(Ace ace,
boolean aToUnicodeExceptionFlag)
Construct an Idna object for converting data to and from an ASCII compatible form. |
|
Idna(Ace ace,
boolean aToUnicodeExceptionFlag,
boolean aIsRegistrationProtocol)
Construct an Idna object for converting data to and from an ASCII compatible form. |
|
| Method Summary | |
|---|---|
char[] |
domainToAscii(int[] input)
Converts an array of integers to a character array |
int[] |
domainToUnicode(char[] input)
Converts a character array to an integer array |
static boolean |
isDelimiter(int c)
Checks if the input int is a delimiter |
static boolean |
isDelimiter(java.lang.String s)
Checks if the input string is a delimiter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int[] INT_DELIMITERS
public static final java.lang.String DELIMITERS
public static final char ACE_DELIMITER
public static final int MAX_DOMAIN_LABEL_LENGTH_IN_OCTETS
public static final boolean DEFAULT_TO_UNICODE_EXCEPTION_FLAG
public static final boolean DEFAULT_REGISTRATION_PROTOCOL
| Constructor Detail |
|---|
public Idna(Ace ace)
throws XcodeException
ace - An Ace object to use during conversion.
XcodeException
public Idna(Ace ace,
boolean aToUnicodeExceptionFlag)
throws XcodeException
ace - An Ace object to use during conversion.aToUnicodeExceptionFlag - See the description for the DEFAULT_TO_UNICODE_EXCEPTION_FLAG
attibute which stores the default value for this parameter.
XcodeException
public Idna(Ace ace,
boolean aToUnicodeExceptionFlag,
boolean aIsRegistrationProtocol)
throws XcodeException
ace - An Ace object to use during conversion.aToUnicodeExceptionFlag - See the description for the DEFAULT_TO_UNICODE_EXCEPTION_FLAG
attibute which stores the default value for this parameter.aIsRegistrationProtocol - Indicates whether or not IDNA2008 Protocol rules are applied
XcodeException| Method Detail |
|---|
public static boolean isDelimiter(java.lang.String s)
s - a string to check
public static boolean isDelimiter(int c)
c - an int to check
public char[] domainToAscii(int[] input)
throws XcodeException
input - an int array
XcodeException - if the input is null or empty
public int[] domainToUnicode(char[] input)
throws XcodeException
input - a character array
XcodeException - if the input is null or empty
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||