Class Punycode


  • public final class Punycode
    extends Object
    Ported code from ICU punycode.c
    • Constructor Detail

      • Punycode

        public 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