puny

package module
v0.0.0-...-050be39 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: BSD-2-Clause Imports: 3 Imported by: 4

README

This repository has moved to gitlab.com/golang-commonmark/puny.

Documentation

Overview

Package puny provides functions for encoding/decoding to/from punycode.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOverflow     = errors.New("overflow: input needs wider integers to process")
	ErrNotBasic     = errors.New("illegal input >= 0x80 (not a basic code point)")
	ErrInvalidInput = errors.New("invalid input")
)

Functions

func Decode

func Decode(s string) (string, error)

Decode converts a Punycode string of ASCII-only symbols to a string of Unicode symbols.

func Encode

func Encode(input string) (string, error)

Encode converts a string of Unicode symbols (e.g. a domain name label) to a Punycode string of ASCII-only symbols.

func ToASCII

func ToASCII(s string) string

ToASCII converts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the domain name will be converted.

func ToUnicode

func ToUnicode(s string) string

ToUnicode converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted.

Types

This section is empty.

Jump to

Keyboard shortcuts

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