Output:use strict; use charnames ':full'; use Mail::RFC822::Address qw(valid); use Encode::Punycode; use Encode; my $email_address = "\N{ARABIC SIGN SALLALLAHOU ALAYHE WASSALLAM}" . ' +@' . "\N{CYPRIOT SYLLABLE TA}" . 'be'; my $puny = encode('Punycode', $email_address); print "$puny\n"; print "That's a valid unicode address\n" if valid($email_address); print "That's a valid Punycode address\n" if valid($email_address);
Update: added Punycode representation.xn--@be-0we00514a That's a valid unicode address That's a valid Punycode address
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In reply to Re: international domain names and email validation
by CountZero
in thread international domain names and email validation
by vkhera
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |