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