raku-community-modules / URI

Raku realization of URI — Uniform Resource Identifiers handler
Artistic License 2.0
3 stars 14 forks source link

Creation of URI objects with unicode in it? #38

Closed ufobat closed 5 years ago

ufobat commented 7 years ago

As far as I understood the URI itself doesn't contain "fancy chars" in it, but what about allowing the constructor to decode them first?

For Example, URI of perl5 does handle this issue:

> p5 -MURI -E 'my $str = shift @ARGV; say URI->new($str)' 'http://127.0.0.1:1234/echo2/☃'    
http://127.0.0.1:1234/echo2/%E2%98%83
> p6 -MURI -e 'sub MAIN($str) {; say URI.new($str) }' 'http://127.0.0.1:1234/echo2/☃'
Could not parse URI: http://127.0.0.1:1234/echo2/☃
  in method parse at /home/martin/.rakudobrew/moar-2017.09/install/share/perl6/site/sources/791F2CA877C73A01F6D9BE0FAB586D948EA58B54 (URI) line 46
  in method new at /home/martin/.rakudobrew/moar-2017.09/install/share/perl6/site/sources/791F2CA877C73A01F6D9BE0FAB586D948EA58B54 (URI) line 130
  in sub MAIN at -e line 1
  in block <unit> at -e line 1