Skip to content

crestonbunch/purescript-punycode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purescript Punycode

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.

About

A punycode implementation in PureScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published