in reply to CPAN's URI.pm versus Japanese as Unicode?
Hello,
You want domain_to_unicode from Net::IDN::Encode, I believe.
#!/usr/bin/perl use utf8; use open ':std', ':encoding(UTF-8)'; use URI; use Net::IDN::Encode 'domain_to_unicode'; use strict; use warnings; my $href="https://マリウス.com/"; print $href,"\n"; my $uri = URI->new($href); my $punycode = $uri->host; print ":",$punycode,"\n"; my $domain = domain_to_unicode($punycode); print $domain, "\n"; exit(0); |
Output:
https://マリウス.com/ :xn--gckvb8fzb.com マリウス.com |
Hope this helps!
Edit: ++haukex posted while I was composing my reply
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CPAN's URI.pm versus Japanese as Unicode?
by mldvx4 (Hermit) on Dec 12, 2022 at 12:49 UTC |