punycode

This module implements Punycode

For information of the spec see rfc3492

Functions

pub fn decode(text: String) -> Result(String, Nil)

Decodes a punycode string into a utf-8 string will return Error(Nil) if the input is not a valid punycode encoded string

Examples

decode(“80aafi6cg”)
Ok(“правда”)

pub fn encode(text: String) -> Result(String, Nil)

Encodes a utf-8 string into a punycode encoded string

Examples

encode(“правда”)
Ok(“80aafi6cg”)

Search Document