Top Description Fields Constructors Methods
com.ibm.icu.impl

public final Class UTS46

extends IDNA
Class Inheritance
Imports
java.util.EnumSet, com.ibm.icu.impl.Normalizer2Impl.UTF16Plus, com.ibm.icu.lang.UCharacter, .UCharacterCategory, .UCharacterDirection, .UScript, com.ibm.icu.text.IDNA, .Normalizer2, .StringPrepParseException, com.ibm.icu.util.ICUException

UTS #46 (IDNA2008) implementation.
Author
Markus Scherer
Since
2010jul09

Field Summary

Modifier and TypeField and Description
private static final byte[]
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
pack-priv final int
private static final int
private static final int
private static final int
private static final int
private static final EnumSet<IDNA.Error>
private static int
private static final Normalizer2
Inherited from com.ibm.icu.text.IDNA:
ALLOW_UNASSIGNEDCHECK_BIDICHECK_CONTEXTJCHECK_CONTEXTODEFAULTNONTRANSITIONAL_TO_ASCIINONTRANSITIONAL_TO_UNICODEUSE_STD3_RULES

Constructor Summary

AccessConstructor and Description
public
UTS46(int options)

Method Summary

Modifier and TypeMethod and Description
private void
checkLabelBiDi(CharSequence label, int labelStart, int labelLength, IDNA.Info info)

private void
checkLabelContextO(CharSequence label, int labelStart, int labelLength, IDNA.Info info)

private static boolean
isASCIIOkBiDi(CharSequence s, int length)

private static boolean
private boolean
isLabelOkContextJ(CharSequence label, int labelStart, int labelLength)

public StringBuilder
labelToASCII(CharSequence
Input domain name label
label
,
StringBuilder
Destination string object
dest
,
IDNA.Info
Output container of IDNA processing details.
info
)

Implements abstract com.ibm.icu.text.IDNA.labelToASCII.

Converts a single domain name label into its ASCII form for DNS lookup.
public StringBuilder
labelToUnicode(CharSequence
Input domain name label
label
,
StringBuilder
Destination string object
dest
,
IDNA.Info
Output container of IDNA processing details.
info
)

Implements abstract com.ibm.icu.text.IDNA.labelToUnicode.

Converts a single domain name label into its Unicode form for human-readable display.
private int
mapDevChars(StringBuilder dest, int labelStart, int mappingStart)

private int
markBadACELabel(StringBuilder dest, int labelStart, int labelLength, boolean toASCII, IDNA.Info info)

public StringBuilder
nameToASCII(CharSequence
Input domain name
name
,
StringBuilder
Destination string object
dest
,
IDNA.Info
Output container of IDNA processing details.
info
)

Implements abstract com.ibm.icu.text.IDNA.nameToASCII.

Converts a whole domain name into its ASCII form for DNS lookup.
public StringBuilder
nameToUnicode(CharSequence
Input domain name
name
,
StringBuilder
Destination string object
dest
,
IDNA.Info
Output container of IDNA processing details.
info
)

Implements abstract com.ibm.icu.text.IDNA.nameToUnicode.

Converts a whole domain name into its Unicode form for human-readable display.
private StringBuilder
process(CharSequence src, boolean isLabel, boolean toASCII, StringBuilder dest, IDNA.Info info)

private int
processLabel(StringBuilder dest, int labelStart, int labelLength, boolean toASCII, IDNA.Info info)

private StringBuilder
processUnicode(CharSequence src, int labelStart, int mappingStart, boolean isLabel, boolean toASCII, StringBuilder dest, IDNA.Info info)

private static int
replaceLabel(StringBuilder dest, int destLabelStart, int destLabelLength, CharSequence label, int labelLength)

private static int
private static int
U_MASK(int x)

Inherited from com.ibm.icu.text.IDNA:
addErroraddLabelErrorcomparecomparecompareconvertIDNToASCIIconvertIDNToASCIIconvertIDNToASCIIconvertIDNToUnicodeconvertIDNToUnicodeconvertIDNToUnicodeconvertToASCIIconvertToASCIIconvertToASCIIconvertToUnicodeconvertToUnicodeconvertToUnicodegetUTS46InstancehasCertainErrorshasCertainLabelErrorsisBiDiisOkBiDipromoteAndResetLabelErrorsresetInfosetBiDisetNotOkBiDisetTransitionalDifferent

Field Detail

asciiDataback to summary
private static final byte[] asciiData
EN_AN_MASKback to summary
private static final int EN_AN_MASK
ES_CS_ET_ON_BN_NSM_MASKback to summary
private static final int ES_CS_ET_ON_BN_NSM_MASK
L_EN_ES_CS_ET_ON_BN_NSM_MASKback to summary
private static final int L_EN_ES_CS_ET_ON_BN_NSM_MASK
L_EN_MASKback to summary
private static final int L_EN_MASK
L_MASKback to summary
private static final int L_MASK
L_R_AL_MASKback to summary
private static final int L_R_AL_MASK
optionsback to summary
pack-priv final int options
R_AL_AN_EN_ES_CS_ET_ON_BN_NSM_MASKback to summary
private static final int R_AL_AN_EN_ES_CS_ET_ON_BN_NSM_MASK
R_AL_AN_MASKback to summary
private static final int R_AL_AN_MASK
R_AL_EN_AN_MASKback to summary
private static final int R_AL_EN_AN_MASK
R_AL_MASKback to summary
private static final int R_AL_MASK
severeErrorsback to summary
private static final EnumSet<IDNA.Error> severeErrors
U_GC_M_MASKback to summary
private static int U_GC_M_MASK
uts46Norm2back to summary
private static final Normalizer2 uts46Norm2

Constructor Detail

UTS46back to summary
public UTS46(int options)

Method Detail

checkLabelBiDiback to summary
private void checkLabelBiDi(CharSequence label, int labelStart, int labelLength, IDNA.Info info)
checkLabelContextOback to summary
private void checkLabelContextO(CharSequence label, int labelStart, int labelLength, IDNA.Info info)
isASCIIOkBiDiback to summary
private static boolean isASCIIOkBiDi(CharSequence s, int length)
isASCIIStringback to summary
private static boolean isASCIIString(CharSequence dest)
isLabelOkContextJback to summary
private boolean isLabelOkContextJ(CharSequence label, int labelStart, int labelLength)
labelToASCIIback to summary
public StringBuilder labelToASCII(CharSequence label, StringBuilder dest, IDNA.Info info)

Implements abstract com.ibm.icu.text.IDNA.labelToASCII.

Doc from com.ibm.icu.text.IDNA.labelToASCII.

Converts a single domain name label into its ASCII form for DNS lookup. If any processing step fails, then info.hasErrors() will be true and the result might not be an ASCII string. The label might be modified according to the types of errors. Labels with severe errors will be left in (or turned into) their Unicode form.

Parameters
label:CharSequence

Input domain name label

dest:StringBuilder

Destination string object

info:IDNA.Info

Output container of IDNA processing details.

Returns:StringBuilder

dest

Annotations
@Override
labelToUnicodeback to summary
public StringBuilder labelToUnicode(CharSequence label, StringBuilder dest, IDNA.Info info)

Implements abstract com.ibm.icu.text.IDNA.labelToUnicode.

Doc from com.ibm.icu.text.IDNA.labelToUnicode.

Converts a single domain name label into its Unicode form for human-readable display. If any processing step fails, then info.hasErrors() will be true. The label might be modified according to the types of errors.

Parameters
label:CharSequence

Input domain name label

dest:StringBuilder

Destination string object

info:IDNA.Info

Output container of IDNA processing details.

Returns:StringBuilder

dest

Annotations
@Override
mapDevCharsback to summary
private int mapDevChars(StringBuilder dest, int labelStart, int mappingStart)
markBadACELabelback to summary
private int markBadACELabel(StringBuilder dest, int labelStart, int labelLength, boolean toASCII, IDNA.Info info)
nameToASCIIback to summary
public StringBuilder nameToASCII(CharSequence name, StringBuilder dest, IDNA.Info info)

Implements abstract com.ibm.icu.text.IDNA.nameToASCII.

Doc from com.ibm.icu.text.IDNA.nameToASCII.

Converts a whole domain name into its ASCII form for DNS lookup. If any processing step fails, then info.hasErrors() will be true and the result might not be an ASCII string. The domain name might be modified according to the types of errors. Labels with severe errors will be left in (or turned into) their Unicode form.

Parameters
name:CharSequence

Input domain name

dest:StringBuilder

Destination string object

info:IDNA.Info

Output container of IDNA processing details.

Returns:StringBuilder

dest

Annotations
@Override
nameToUnicodeback to summary
public StringBuilder nameToUnicode(CharSequence name, StringBuilder dest, IDNA.Info info)

Implements abstract com.ibm.icu.text.IDNA.nameToUnicode.

Doc from com.ibm.icu.text.IDNA.nameToUnicode.

Converts a whole domain name into its Unicode form for human-readable display. If any processing step fails, then info.hasErrors() will be true. The domain name might be modified according to the types of errors.

Parameters
name:CharSequence

Input domain name

dest:StringBuilder

Destination string object

info:IDNA.Info

Output container of IDNA processing details.

Returns:StringBuilder

dest

Annotations
@Override
processback to summary
private StringBuilder process(CharSequence src, boolean isLabel, boolean toASCII, StringBuilder dest, IDNA.Info info)
processLabelback to summary
private int processLabel(StringBuilder dest, int labelStart, int labelLength, boolean toASCII, IDNA.Info info)
processUnicodeback to summary
private StringBuilder processUnicode(CharSequence src, int labelStart, int mappingStart, boolean isLabel, boolean toASCII, StringBuilder dest, IDNA.Info info)
replaceLabelback to summary
private static int replaceLabel(StringBuilder dest, int destLabelStart, int destLabelLength, CharSequence label, int labelLength)
U_GET_GC_MASKback to summary
private static int U_GET_GC_MASK(int c)
U_MASKback to summary
private static int U_MASK(int x)