APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.icu.impl

public final Class Punycode

extends Object
Class Inheritance
Imports
java.text.ParseException, jdk.internal.icu.lang.UCharacter, jdk.internal.icu.text.UTF16

Ported code from ICU punycode.c
Author
ram

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int
adaptBias(int delta, int length, boolean firstTime)

private static char
asciiCaseMap(char b, boolean uppercase)

public static StringBuffer
decode(StringBuffer src, boolean[] caseFlags)

Converts Punycode to Unicode.

private static final int
decodeDigit(int cp)

Returns: the numeric value of a basic code point (for use in representing integers) in the range 0 to BASE-1, or a negative value if cp is invalid.

private static char
digitToBasic(int digit, boolean uppercase)

digitToBasic() returns the basic code point whose value (when used for representing integers) is d, which must be in the range 0 to BASE-1.

public static StringBuffer
encode(StringBuffer src, boolean[] caseFlags)

Converts Unicode to Punycode.

private static boolean
isBasic(int ch)

private static boolean
private static boolean
isSurrogate(int ch)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BASEback to summary
private static final int BASE
CAPITAL_Aback to summary
private static final int CAPITAL_A
CAPITAL_Zback to summary
private static final int CAPITAL_Z
DAMPback to summary
private static final int DAMP
DECODE_MAX_CHARSback to summary
private static final int DECODE_MAX_CHARS
DELIMITERback to summary
private static final int DELIMITER
ENCODE_MAX_CODE_UNITSback to summary
private static final int ENCODE_MAX_CODE_UNITS
HYPHENback to summary
private static final int HYPHEN
INITIAL_BIASback to summary
private static final int INITIAL_BIAS
INITIAL_Nback to summary
private static final int INITIAL_N
MAX_CP_COUNTback to summary
private static final int MAX_CP_COUNT
NINEback to summary
private static final int NINE
SKEWback to summary
private static final int SKEW
SMALL_Aback to summary
private static final int SMALL_A
SMALL_Zback to summary
private static final int SMALL_Z
TMAXback to summary
private static final int TMAX
TMINback to summary
private static final int TMIN
ZEROback to summary
private static final int ZERO

Constructor Detail

Punycodeback to summary
public Punycode()

Method Detail

adaptBiasback to summary
private static int adaptBias(int delta, int length, boolean firstTime)
asciiCaseMapback to summary
private static char asciiCaseMap(char b, boolean uppercase)
decodeback to summary
public static StringBuffer decode(StringBuffer src, boolean[] caseFlags) throws ParseException

Converts Punycode to Unicode. The Unicode string will be at most as long as the Punycode string.

decodeDigitback to summary
private static final int decodeDigit(int cp)
Returns:int

the numeric value of a basic code point (for use in representing integers) in the range 0 to BASE-1, or a negative value if cp is invalid.

digitToBasicback to summary
private static char digitToBasic(int digit, boolean uppercase)

digitToBasic() returns the basic code point whose value (when used for representing integers) is d, which must be in the range 0 to BASE-1. The lowercase form is used unless the uppercase flag is nonzero, in which case the uppercase form is used.

encodeback to summary
public static StringBuffer encode(StringBuffer src, boolean[] caseFlags) throws ParseException

Converts Unicode to Punycode. The input string must not contain single, unpaired surrogates. The output will be represented as an array of ASCII code points.

isBasicback to summary
private static boolean isBasic(int ch)
isBasicUpperCaseback to summary
private static boolean isBasicUpperCase(int ch)
isSurrogateback to summary
private static boolean isSurrogate(int ch)