MCPcopy Create free account
hub / github.com/foxcpp/maddy / SelectIDNA

Function SelectIDNA

framework/address/rfc6531.go:80–85  ·  view source on GitHub ↗

SelectIDNA is a convenience function for conversion of domains in the email addresses to/from the Punycode form. ulabel=true => ToUnicode is used. ulabel=false => ToASCII is used.

(ulabel bool, addr string)

Source from the content-addressed store, hash-verified

78// ulabel=true => ToUnicode is used.
79// ulabel=false => ToASCII is used.
80func SelectIDNA(ulabel bool, addr string) (string, error) {
81 if ulabel {
82 return ToUnicode(addr)
83 }
84 return ToASCII(addr)
85}

Callers 2

WriteToMethod · 0.92
WriteToMethod · 0.92

Calls 2

ToUnicodeFunction · 0.85
ToASCIIFunction · 0.85

Tested by

no test coverage detected