Only browser which handles spaces in search queries differently
-
Why is Vivaldi the only browser (that I tested, of 5) that encodes blank spaces after the ? in search queries as %20 rather than as +, as all the other browsers do?
Others use:
https://www.mojeek.com/search?q=vivaldi+browser
Vivaldi
https://www.mojeek.com/search?q=vivaldi browserThis was raised previously: https://forum.vivaldi.net/topic/40634/privacy-and-the-rise-of-the-alternative-search-engine/11
-
@colinhayhurst Hello and Welcome to the Vivaldi Community
Yes, I've been wondering about this too. Percent-encoding of spaces in the query part of the URL is really bad for legibility, even if it might be the right way according to the specification. Every time this comes up I do a bit of searching but never really arrive at a good answer as to what is the "correct" way of encoding the query part.
RFC 3986 (URI spec) says spaces should be encoded as
%20
, and pluses as%2B
since they are a reserved character."For example, "%20" is the percent-encoding for the binary octet "00100000" (ABNF: %x20), which in US-ASCII corresponds to the space character (SP)."
https://datatracker.ietf.org/doc/html/rfc3986#section-2.1However RFC 1866 says that for form data, the part after the
?
in a query, spaces should be replaced by+
."The form field names and values are escaped: space characters are replaced by
+
[...]"
https://datatracker.ietf.org/doc/html/rfc1866#section-8.2How the data in the query part (after
?
) is handled on the server side is really up to the web application (site), hence why a (badly coded) site like Mojeek throws a 403 when the URL contains a lot of%20
Generally, I think Vivaldi should encode spaces in the form data part like other browsers, if not anything else than for legibility of the query part. And like it's done now (with
%20
) could create problems when copying search URLs to send to others over email and forums etc.Some more (possibly) enlightening reading:
https://newbedev.com/url-encoding-the-space-character-or-20http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
https://stackoverflow.com/questions/2678551/when-to-encode-space-to-plus-or-20
-
In addition, URL encoding is handled differently depending on the browser:
The following URL:
https://example.com/this is a path with spaces/?this is the query part
Ends up looking like this in Vivaldi:
https://example.com/this is a path with spaces/?this%20is%20the%20query%20part
(When copied will have full encoding - depending on the "Copy and Cut Encoded Address" setting)Firefox:
https://example.com/this is a path with spaces/?this is the query part
(When copied will have full encoding - depening on thebrowser.urlbar.decodeURLsOnCopy
setting)Opera, Brave, Chromium:
https://example.com/this%20is%20a%20path%20with%20spaces/?this%20is%20the%20query%20part
-
//EDIT:
I was told in internal chat that i am wrong:I would argue that Mojeek is the one violating specs by not interpreting %20 as space.
https://url.spec.whatwg.org/#urlencoded-parsing
Let nameString and valueString be the result of running UTF-8 decode without BOM on the percent-decoding of name and value, respectively.
Additionally, the spec says nothing about the requirement to encode spaces as +:
https://url.spec.whatwg.org/#urlencoded-serializing
Notes:
-
As described in https://html.spec.whatwg.org/multipage/forms.html#the-form-element, the default encoding type for form submission is application/x-www-form-urlencoded
-
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#url-encoded-form-data indicates that URL-encoded form data should be parsed as per the URL spec
Oh, seems i was wrong to tell that Vivialdis encoding violates web standards. It does not violate.
Sorry. My reference to standards was too old.
May be Mojeek is not decoding sent URL parameters correct.
Please ask Mojeek support. -
-
@doctorg thanks. I'm the poster of the question and from Mojeek; we are still awaiting an answer from Vivaldi since 2019, when another member of our team first raised it.
-
Ppafflick moved this topic from Vivaldi for macOS on
-
Ppafflick moved this topic from Websites on