punycoder

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

punyc😀der

Circleci Builds Github Issues Github Activity
Go Version License Version

TLDR

Punycoder converts international domain names to their punycode representations on the commandline.

Longer Version

IDNA (Internationalized Domain Name in Applications) is a set of standards and protocols used to support non-ASCII characters in domain names. Punycode is a method used in IDNA to encode non-ASCII characters into ASCII characters that can be used in domain names, making them backwards compatible with existing implementations.

This is done by first converting the non-ASCII characters into their Unicode code points, and then encoding those code points using a special base-36 encoding scheme. The resulting string of ASCII characters is prefixed with the characters "xn--" to indicate that it is a Punycode-encoded domain name.

For example, the Punycode representation of a legal domain name 1❤️.ws is xn--1-7iqv272g.ws.

What's new

v0.2.1 (25/05/23)
  • refactored cli args.
v0.2.0 (22/05/23)
  • support unicode encoding of punycode
v0.1.0 (05/05/23)
  • upgrade to go 1.20
v0.0.11 (04/05/23)
  • added goreleaser and made available on homebrew

Up and running

Homebrew
brew tap simonmittag/cli &&
  brew install punycoder &&
  punycoder 
Golang
git clone https://github.com/simonmittag/punycoder && cd punycoder && 
go install github.com/simonmittag/punycoder/cmd/punycoder && 
punycoder 

Usage

λ Usage: punycoder host | [-u] host | [-v] | [-h]
  -h    print usage
  -u    convert to unicode
  -v    print punycoder version

Examples

Use punycoder with bash pipes reading from stdin

echo 1❤️.ws | punycoder | nslookup
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	xn--1-7iqv272g.ws
Address: 64.70.19.203
echo xn--1-7iqv272g.ws | punycoder -u 
1❤️.ws

Contributions

The punycoder team welcomes all contributors. Everyone interacting with the project's codebase, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct

Documentation

Index

Constants

View Source
const Version string = "v0.2.1"

Variables

This section is empty.

Functions

func EncodeAscii

func EncodeAscii(p string) string

func EncodeUnicode added in v0.2.0

func EncodeUnicode(p string) string

Types

This section is empty.

Directories

Path Synopsis
cmd
punycoder command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL