punycode

    RFC 3492 Punycode for MoonBit

    unicode
    punycode
    rfc3492
    Download zip
    Version
    0.8.1
    License
    Apache-2.0
    Last updated
    yesterday
    Downloads
    31K

    No dependencies

    #punycode

    RFC 3492 Punycode encoding and decoding for MoonBit.

    moon add moonbit-community/punycode

    See the repository root README for API documentation and examples.

    PunycodeError

    pub(all) suberror PunycodeError {
    Overflow
    InvalidInput
    BadInput
    }

    Error type for Punycode operations

    PunycodeError::output

    fn PunycodeError::output(self : PunycodeError, logger : &Logger) -> Unit

    PunycodeError::to_string

    fn PunycodeError::to_string(self : PunycodeError) -> String

    decode

    fn decode(input : StringView) -> String raise PunycodeError

    Decode a Punycode string to Unicode

    encode

    fn encode(input : StringView) -> String raise PunycodeError

    Encode a Unicode string to Punycode

    encode_to

    fn encode_to(input : StringView, output : StringBuilder) -> Int raise PunycodeError

    Encode a Unicode string to Punycode at the end of output, and return the number of characters written, all of them ASCII.

    When encoding fails, part of the encoding may already be in output.

    Source Files