I'm not an RFC wizard, but I've seen this come up before and it's an
excellent question.

$ perl -MMojo::Parameters -E 'say Mojo::Parameters->new(var=>"a b")'
var=a+b
$ perl -MMojo::Parameters -E 'say Mojo::Parameters->new("a b")->to_string'
a%20b

This struck me as interesting, so I dug into RFC3986
<http://tools.ietf.org/html/rfc3986> (as referenced by Mojo::Parameters
<https://mojolicious.org/perldoc/Mojo/Parameters>) and I see this from section
3.4 <https://tools.ietf.org/html/rfc3986#section-3.4>:

However, as query components are often used to carry identifying
information in the form of "key=value" pairs and one frequently used value
is a reference to another URI, *it is sometimes better for usability to
avoid percent- encoding those characters*.


So, given that bold, I take it to mean that Mojo::Parameters decided to go
for what's "sometimes better".  :)

On Wed, Feb 20, 2019 at 8:55 AM Lars Thegler <[email protected]> wrote:

> Hi,
>
> I would have expected
>
>   Mojo::URL->new(...)->query(var=>'a b')
>
> to return
>
>   ...?var=a%20b
>
> but instead it does
>
>   ...?var=a+b
>
> Is this as intended? It's not how RFC3986 specifies it, as far as I can
> tell.
>
> /Lars
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to