From b63e24436ccb9d730088a80b9ee5c9c71a00b990 Mon Sep 17 00:00:00 2001 From: Julien Fiegehenn Date: Sat, 29 Apr 2023 17:08:42 +0100 Subject: URI-5.18 - Add a GH workflow to test LWP::Curl (GH#116) (Olaf Alders) - Add documentation examples for the host() and ihost() methods (GH#28) (Sebastian Willing) - Remove colon from username:password if there is no password (GH#31) (David E. Wheeler, Joenio Marques da Costa, Julien Fiegehenn) - Prefix private methods with _ in URI::_punycode (GH#47) (David E Wheeler) --- Changes | 2 +- README.md | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 002340a..58e43fb 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,6 @@ Revision history for URI -{{$NEXT}} +5.18 2023-04-29 16:08:14Z - Add a GH workflow to test LWP::Curl (GH#116) (Olaf Alders) - Add documentation examples for the host() and ihost() methods (GH#28) (Sebastian Willing) diff --git a/README.md b/README.md index a0f8a30..d9ab4bc 100644 --- a/README.md +++ b/README.md @@ -430,7 +430,7 @@ methods. Sets and returns the unescaped hostname. - If the $new\_host string ends with a colon and a number, then this + If the `$new_host` string ends with a colon and a number, then this number also sets the port. For IPv6 addresses the brackets around the raw address is removed in the return @@ -438,9 +438,16 @@ methods. can use a raw address or one enclosed in brackets. The address needs to be enclosed in brackets if you want to pass in a new port value as well. + my $uri = URI->new("http://www.\xC3\xBCri-sample/foo/bar.html"); + print $u->host; # www.xn--ri-sample-fra0f + - $uri->ihost - Returns the host in Unicode form. Any IDNA A-labels are turned into U-labels. + Returns the host in Unicode form. Any IDNA A-labels (encoded unicode chars with + _xn--_ prefix) are turned into U-labels (unicode chars). + + my $uri = URI->new("http://www.\xC3\xBCri-sample/foo/bar.html"); + print $u->ihost; # www.\xC3\xBCri-sample - $uri->port - $uri->port( $new\_port ) -- cgit v1.2.1