Thanks, though adding use utf8 does not affect the result
Yes, it does.
... the host name needs to remain human-readable. The goal is to extract the host name from the URI and the host name happens to be Japanese as Unicode, ...
Corion already pointed you to Net::IDN::Encode as one possibility.
use warnings; use strict; use utf8; use open qw/:std :encoding(UTF-8)/; use URI; use Net::IDN::Encode qw/domain_to_unicode/; my $href="https://マリウス.com/"; my $uri = URI->new($href); my $domain = domain_to_unicode($uri->host); print $domain,"\n"; # prints "マリウス.com"
In reply to Re^3: CPAN's URI.pm versus Japanse as Unicode?
by haukex
in thread CPAN's URI.pm versus Japanese as Unicode?
by mldvx4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |