Package

purescript-punycode

Repository
crestonbunch/purescript-punycode
License
MIT
Uploaded by
pacchettibotti
Published on
2024-01-26T02:01:26Z

An implementation of Punycode as described by RFC3492 in PureScript.

In addition to encoding/decoding arbitrary punycode, it also implements toASCII and toUnicode from RFC3490 for the special cases of domain names and email addresses.

Usage

spago install punycode

The API is quite simple:

encode "my unicode string"
decode "my ascii string"

toUnicode "example.com"
toASCII "example.com"

All functions return an Either Error String, so you can handle cases where the input fails to encode/decode. There are no side effects.

Acknowledgements

This was influenced by the implementation in punycode.js in addition to the pseudocode from the RFC.

Modules
Web.Punycode
Dependencies