func (p *Profile) String() string {
	s := ""
	if p.transitional {
		s = "Transitional"
	} else {
		s = "NonTransitional"
	}
	if p.useSTD3Rules {
		s += ":UseSTD3Rules"
	}
	if p.checkHyphens {
		s += ":CheckHyphens"
	}
	if p.checkJoiners {
		s += ":CheckJoiners"
	}
	if p.verifyDNSLength {
		s += ":VerifyDNSLength"
	}
	return s
}
String reports a string with a description of the profile for debugging
purposes. The string format may change with different versions.
package idna  
import (
	"fmt"
	"strings"
	"unicode/utf8"
	"golang.org/x/text/secure/bidirule"
	"golang.org/x/text/unicode/norm"
)
func ToASCII(s string) (string, error) {
	return Punycode.process(s, true)
}
func ToUnicode(s string) (string, error) {
	return Punycode.process(s, false)
}
type Option func(*options)
func Transitional(transitional bool) Option {
	return func(o *options) { o.transitional = true }
}
func VerifyDNSLength(verify bool) Option {
	return func(o *options) { o.verifyDNSLength = verify }
}
func RemoveLeadingDots(remove bool) Option {
	return func(o *options) { o.removeLeadingDots = remove }
}
func ValidateLabels(enable bool) Option {
	return func(o *options) {
		if o.mapping == nil && enable {
			o.mapping = normalize
		}
		o.trie = trie
		o.checkJoiners = enable
		o.checkHyphens = enable
		if enable {
			o.fromPuny = validateFromPunycode
		} else {
			o.fromPuny = nil
		}
	}
}
func CheckHyphens(enable bool) Option {
	return func(o *options) { o.checkHyphens = enable }
}
func CheckJoiners(enable bool) Option {
	return func(o *options) {
		o.trie = trie
		o.checkJoiners = enable
	}
}
func StrictDomainName(use bool) Option {
	return func(o *options) { o.useSTD3Rules = use }
}
func BidiRule() Option {
	return func(o *options) { o.bidirule = bidirule.ValidString }
}
func ValidateForRegistration() Option {
	return func(o *options) {
		o.mapping = validateRegistration
		StrictDomainName(true)(o)
		ValidateLabels(true)(o)
		VerifyDNSLength(true)(o)
		BidiRule()(o)
	}
}
func MapForLookup() Option {
	return func(o *options) {
		o.mapping = validateAndMap
		StrictDomainName(true)(o)
		ValidateLabels(true)(o)
		RemoveLeadingDots(true)(o)
	}
}
type options struct {
	transitional      bool
	useSTD3Rules      bool
	checkHyphens      bool
	checkJoiners      bool
	verifyDNSLength   bool
	removeLeadingDots bool
	trie *idnaTrie
	fromPuny func(p *Profile, s string) error
	mapping func(p *Profile, s string) (string, error)
	bidirule func(s string) bool
}
type Profile struct {
	options
}
func apply(o *options, opts []Option) {
	for _, f := range opts {
		f(o)
	}
}
func New(o ...Option) *Profile {
	p := &Profile{}
	apply(&p.options, o)
	return p
}
func (p *Profile) ToASCII(s string) (string, error) {
	return p.process(s, true)
}
func (p *Profile) ToUnicode(s string) (string, error) {
	pp := *p
	pp.transitional = false
	return pp.process(s, false)
}