Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/sogaiu/janet-punyishcode
- Owner: sogaiu
- Created: 2023-11-23T11:19:34.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-06T15:58:24.000Z (5 months ago)
- Last Synced: 2024-08-06T18:51:59.685Z (5 months ago)
- Topics: idna, janet, punycode, unicode
- Language: Janet
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.