Package com.ibm.icu.impl
Class UTS46
- java.lang.Object
-
- com.ibm.icu.text.IDNA
-
- com.ibm.icu.impl.UTS46
-
public final class UTS46 extends IDNA
UTS #46 (IDNA2008) implementation.- Since:
- 2010jul09
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ibm.icu.text.IDNA
IDNA.Error, IDNA.Info
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
asciiData
private static int
EN_AN_MASK
private static int
ES_CS_ET_ON_BN_NSM_MASK
private static int
L_EN_ES_CS_ET_ON_BN_NSM_MASK
private static int
L_EN_MASK
private static int
L_MASK
private static int
L_R_AL_MASK
(package private) int
options
private static int
R_AL_AN_EN_ES_CS_ET_ON_BN_NSM_MASK
private static int
R_AL_AN_MASK
private static int
R_AL_EN_AN_MASK
private static int
R_AL_MASK
private static java.util.EnumSet<IDNA.Error>
severeErrors
private static int
U_GC_M_MASK
private static Normalizer2
uts46Norm2
-
Fields inherited from class com.ibm.icu.text.IDNA
ALLOW_UNASSIGNED, CHECK_BIDI, CHECK_CONTEXTJ, CHECK_CONTEXTO, DEFAULT, NONTRANSITIONAL_TO_ASCII, NONTRANSITIONAL_TO_UNICODE, USE_STD3_RULES
-
-
Constructor Summary
Constructors Constructor Description UTS46(int options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkLabelBiDi(java.lang.CharSequence label, int labelStart, int labelLength, IDNA.Info info)
private void
checkLabelContextO(java.lang.CharSequence label, int labelStart, int labelLength, IDNA.Info info)
private static boolean
isASCIIOkBiDi(java.lang.CharSequence s, int length)
private static boolean
isASCIIString(java.lang.CharSequence dest)
private boolean
isLabelOkContextJ(java.lang.CharSequence label, int labelStart, int labelLength)
java.lang.StringBuilder
labelToASCII(java.lang.CharSequence label, java.lang.StringBuilder dest, IDNA.Info info)
Converts a single domain name label into its ASCII form for DNS lookup.java.lang.StringBuilder
labelToUnicode(java.lang.CharSequence label, java.lang.StringBuilder dest, IDNA.Info info)
Converts a single domain name label into its Unicode form for human-readable display.private int
mapDevChars(java.lang.StringBuilder dest, int labelStart, int mappingStart)
private int
markBadACELabel(java.lang.StringBuilder dest, int labelStart, int labelLength, boolean toASCII, IDNA.Info info)
java.lang.StringBuilder
nameToASCII(java.lang.CharSequence name, java.lang.StringBuilder dest, IDNA.Info info)
Converts a whole domain name into its ASCII form for DNS lookup.java.lang.StringBuilder
nameToUnicode(java.lang.CharSequence name, java.lang.StringBuilder dest, IDNA.Info info)
Converts a whole domain name into its Unicode form for human-readable display.private java.lang.StringBuilder
process(java.lang.CharSequence src, boolean isLabel, boolean toASCII, java.lang.StringBuilder dest, IDNA.Info info)
private int
processLabel(java.lang.StringBuilder dest, int labelStart, int labelLength, boolean toASCII, IDNA.Info info)
private java.lang.StringBuilder
processUnicode(java.lang.CharSequence src, int labelStart, int mappingStart, boolean isLabel, boolean toASCII, java.lang.StringBuilder dest, IDNA.Info info)
private static int
replaceLabel(java.lang.StringBuilder dest, int destLabelStart, int destLabelLength, java.lang.CharSequence label, int labelLength)
private static int
U_GET_GC_MASK(int c)
private static int
U_MASK(int x)
-
Methods inherited from class com.ibm.icu.text.IDNA
addError, addLabelError, compare, compare, compare, convertIDNToASCII, convertIDNToASCII, convertIDNToASCII, convertIDNToUnicode, convertIDNToUnicode, convertIDNToUnicode, convertToASCII, convertToASCII, convertToASCII, convertToUnicode, convertToUnicode, convertToUnicode, getUTS46Instance, hasCertainErrors, hasCertainLabelErrors, isBiDi, isOkBiDi, promoteAndResetLabelErrors, resetInfo, setBiDi, setNotOkBiDi, setTransitionalDifferent
-
-
-
-
Field Detail
-
uts46Norm2
private static final Normalizer2 uts46Norm2
-
options
final int options
-
severeErrors
private static final java.util.EnumSet<IDNA.Error> severeErrors
-
asciiData
private static final byte[] asciiData
-
L_MASK
private static final int L_MASK
-
R_AL_MASK
private static final int R_AL_MASK
-
L_R_AL_MASK
private static final int L_R_AL_MASK
-
R_AL_AN_MASK
private static final int R_AL_AN_MASK
-
EN_AN_MASK
private static final int EN_AN_MASK
-
R_AL_EN_AN_MASK
private static final int R_AL_EN_AN_MASK
-
L_EN_MASK
private static final int L_EN_MASK
-
ES_CS_ET_ON_BN_NSM_MASK
private static final int ES_CS_ET_ON_BN_NSM_MASK
-
L_EN_ES_CS_ET_ON_BN_NSM_MASK
private static final int L_EN_ES_CS_ET_ON_BN_NSM_MASK
-
R_AL_AN_EN_ES_CS_ET_ON_BN_NSM_MASK
private static final int R_AL_AN_EN_ES_CS_ET_ON_BN_NSM_MASK
-
U_GC_M_MASK
private static int U_GC_M_MASK
-
-
Method Detail
-
labelToASCII
public java.lang.StringBuilder labelToASCII(java.lang.CharSequence label, java.lang.StringBuilder dest, IDNA.Info info)
Description copied from class:IDNA
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.- Specified by:
labelToASCII
in classIDNA
- Parameters:
label
- Input domain name labeldest
- Destination string objectinfo
- Output container of IDNA processing details.- Returns:
- dest
-
labelToUnicode
public java.lang.StringBuilder labelToUnicode(java.lang.CharSequence label, java.lang.StringBuilder dest, IDNA.Info info)
Description copied from class:IDNA
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.- Specified by:
labelToUnicode
in classIDNA
- Parameters:
label
- Input domain name labeldest
- Destination string objectinfo
- Output container of IDNA processing details.- Returns:
- dest
-
nameToASCII
public java.lang.StringBuilder nameToASCII(java.lang.CharSequence name, java.lang.StringBuilder dest, IDNA.Info info)
Description copied from class:IDNA
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.- Specified by:
nameToASCII
in classIDNA
- Parameters:
name
- Input domain namedest
- Destination string objectinfo
- Output container of IDNA processing details.- Returns:
- dest
-
nameToUnicode
public java.lang.StringBuilder nameToUnicode(java.lang.CharSequence name, java.lang.StringBuilder dest, IDNA.Info info)
Description copied from class:IDNA
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.- Specified by:
nameToUnicode
in classIDNA
- Parameters:
name
- Input domain namedest
- Destination string objectinfo
- Output container of IDNA processing details.- Returns:
- dest
-
isASCIIString
private static boolean isASCIIString(java.lang.CharSequence dest)
-
process
private java.lang.StringBuilder process(java.lang.CharSequence src, boolean isLabel, boolean toASCII, java.lang.StringBuilder dest, IDNA.Info info)
-
processUnicode
private java.lang.StringBuilder processUnicode(java.lang.CharSequence src, int labelStart, int mappingStart, boolean isLabel, boolean toASCII, java.lang.StringBuilder dest, IDNA.Info info)
-
mapDevChars
private int mapDevChars(java.lang.StringBuilder dest, int labelStart, int mappingStart)
-
replaceLabel
private static int replaceLabel(java.lang.StringBuilder dest, int destLabelStart, int destLabelLength, java.lang.CharSequence label, int labelLength)
-
processLabel
private int processLabel(java.lang.StringBuilder dest, int labelStart, int labelLength, boolean toASCII, IDNA.Info info)
-
markBadACELabel
private int markBadACELabel(java.lang.StringBuilder dest, int labelStart, int labelLength, boolean toASCII, IDNA.Info info)
-
checkLabelBiDi
private void checkLabelBiDi(java.lang.CharSequence label, int labelStart, int labelLength, IDNA.Info info)
-
isASCIIOkBiDi
private static boolean isASCIIOkBiDi(java.lang.CharSequence s, int length)
-
isLabelOkContextJ
private boolean isLabelOkContextJ(java.lang.CharSequence label, int labelStart, int labelLength)
-
checkLabelContextO
private void checkLabelContextO(java.lang.CharSequence label, int labelStart, int labelLength, IDNA.Info info)
-
U_MASK
private static int U_MASK(int x)
-
U_GET_GC_MASK
private static int U_GET_GC_MASK(int c)
-
-