Punycode

Package Version Hex Docs

Quick start


import punycode
import gleam/io

// will print elkjp-yua
case punycode.encode("elkjøp") {
   Ok(encoded) -> io.println(encoded) 
   Error(Nil) -> io.println("Encoding failed")
}

// will print elkjøp
case punycode.decode("elkjp-yua") {
   Ok(encoded) -> io.println(encoded) 
   Error(Nil) -> io.println("Encoding failed")
}
gleam test  # Run the tests

Installation

If available on Hex this package can be added to your Gleam project:

gleam add punycode

and its documentation can be found at https://hexdocs.pm/punycode.

Search Document