This repository has been archived in favor of punycode.
A simple CLI tool to decode a punycode encoded string
Decoding a single string, meaning conversion from punycode to human readable text
punydecode xn--blbrgrd-fxak7pWill emit
blåbærgrød
As an alternative to provided arguments, you can pipe text into punyencode
echo xn--blbrgrd-fxak7p | punydecodeWill emit
blåbærgrød
Installation is easy using Go
go install github.com/jonasbn/punydecode@latestIf you want a particular version, please see Go Modules Reference
If you want to encode into punycode, see punyencode.
-
0success, provided string has been decoded and printed -
1failure no argument provided or data from STDIN -
2failure reading from STDIN
This utility requires:
In addition to a few of the standard libraries
There a no known bugs, please see the GitHub repository issues section for a up to date listing.
The utility is limited to decoding to Unicode (version 13) from Punycode.
Please see golang.org/x/net/idna for details.
punydecode only takes a single argument.
punydecode xn--blbrgrd-fxak7p- jonasbn
This utility was created, when in the process of learning Go. I have worked in the DNS and domain name business for a decade so it was only natural to work on something I know when learning Go.
This particular repository touched the following topics:
- Learning to make CLI tools
- Making an executable distributable and installable component
- Reading data from the CLI
- Reading data from STDIN
- Testing a CLI tool / Main function in Go
See the resources and references below for resources on the above topics.
- Wikipedia: Punycode
- Go Modules Reference
- GitHub: punyencode
- golang.org/x/net/idna
- yourbasic.org/golang: Read a file (stdin) line by line
- Blog post: Test the main function in Go by Johannes Malsam
Copyright Jonas Brømsø (jonasbn) 2022
MIT License, see separate LICENSE file