Re: (RFC 3986) Clarification around interpreting literal plus in URLs (U+002B)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Raghu

your question is about page?key=A+B
i.e. a form submission, where the + means and is interpreted as a space in form encoding.

see
https://boldena.com/article/42758
for an explanation.

I haven't checked later W3C specs to see if they attempt to resolve this inconsistency. I would guess not. Similar inconsistencies appear around e.g. use of the ampersand & in form field separation. Forms were a hack, basically., now codified in standards.

best

Lloyd Wood
lloyd.wood@xxxxxxxxxxx


On Friday, March 14, 2025, 21:32, Raghu Saxena <poiasdpoiasd@xxxxxxxx> wrote:

Dear IETF Community,

I was writing to seek clarification around URIs & HTTP, specifically how
to handle "plus" ("+") symbols in them.

For instance, if my server receives a request for `GET /page?key=A+B` ,
where the bytes over the wire are literally [0x412B42], should I
interpret it as literally that byte sequence, or decode the "+" to a
space, thereby interpreting the bytes as [0x412042]?

From my reading of RFC3986, it seems that "+" is a reserved character,
but it's not clear how it is to be interpreted / decoded.

The question behind the question is how should spaces be encoded to be
URL safe; it seems "%20" is the recommended approach, however some
languages (such as Golang[0]) implement query-escaping where the spaces
(0x20) are replaced by a literal "+" (0x2B). This causes problems by
some libraries which then treat this as a literal "plus" (0x2B) and then
return unexpected results.

Regards,

Raghu Saxena

[0]
https://github.com/golang/go/blob/a1ddbdd3ef8b739aab53f20d6ed0a61c3474cf12/src/net/url/url.go#L328-L330


[Index of Archives]     [IETF Annoucements]     [IETF]     [IP Storage]     [Yosemite News]     [Linux SCTP]     [Linux Newbies]     [Mhonarc]     [Fedora Users]

  Powered by Linux