Package com.ibm.icu.impl
Class Punycode
- java.lang.Object
-
- com.ibm.icu.impl.Punycode
-
public final class Punycode extends Object
Ported code from ICU punycode.c
-
-
Constructor Summary
Constructors Constructor Description Punycode()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringBuilderdecode(CharSequence src, boolean[] caseFlags)Converts Punycode to Unicode.static StringBuilderencode(CharSequence src, boolean[] caseFlags)Converts Unicode to Punycode.
-
-
-
Method Detail
-
encode
public static StringBuilder encode(CharSequence src, boolean[] caseFlags) throws StringPrepParseException
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.- Parameters:
src- The source of the String Buffer passed.caseFlags- The boolean array of case flags.- Returns:
- An array of ASCII code points.
- Throws:
StringPrepParseException
-
decode
public static StringBuilder decode(CharSequence src, boolean[] caseFlags) throws StringPrepParseException
Converts Punycode to Unicode. The Unicode string will be at most as long as the Punycode string.- Parameters:
src- The source of the string buffer being passed.caseFlags- The array of boolean case flags.- Returns:
- StringBuilder string.
- Throws:
StringPrepParseException
-
-