Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sogaiu/janet-punyishcode

Punycode decoding / encoding in Janet
https://github.com/sogaiu/janet-punyishcode

idna janet punycode unicode

Last synced: 6 days ago
JSON representation

Punycode decoding / encoding in Janet

Awesome Lists containing this project

README

        

# punyishcode

[Punycode](https://en.wikipedia.org/wiki/Punycode) decoding / encoding in Janet.

# Usage

```janet
(import punyishcode :as p)

(p/decode "de-jg4avhby1noc0d")
# =>
@"パフィーdeルンバ"

(p/encode "München-Ost")
# =>
@"Mnchen-Ost-9db"
```

Note: In the example above, the return value for `(p/decode ...)` may
show up as:

```
@"\xE3\x83\x91\xE3\x83\x95\xE3\x82\xA3\xE3\x83\xBCde\xE3\x83\xAB\xE3\x83\xB3\xE3\x83\x90"
```

By doing `(print _)` after evaluating a `p/decode` form, one is more
likely to see the result in a readable fashion.