-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.01_OS
-
Fix Version/s: V4.01_ERRATA01
-
Component/s: URL Conventions
-
Labels:
-
Proposal:
-
Resolution:
OData URL is based on RFC3986, which in Section 2.1 Percent-Encoding explicitly defines %20 as the encoding for space.
Unfortunately RFC3986 is less clear on the encoding of the plus (+) character: Section 2.2 Reserved Characters recommends %2B as the encoding for plus “unless […] specifically allowed by the URI scheme to represent data in that component”.
As a consequence, many URL-encoding tools, and the most commonly used browsers (Chrome, Edge, Firefox) do not percent-encode the plus character and retain it as a plus character.
To make matters really confusing the WhatWG URL specification defines an API for manipulating URLs that - depending on how it is used - will encode space as the the plus (+) character:
var x = new URL("http://foo?bar=a+b c") x.href // --> http://foo/?bar=a+b%20c var y = new URL("http://foo") y.searchParams.append("bar","a+b c") y.href // --> http://foo/?bar=a%2Bb+c
This raises the question on how an OData service SHOULD / MUST interpret the plus (+) character in a URL:
- does it mean plus,
- or does it mean space?
Note: the percent-encoded variants are unambiguous:
- %20 means space
- %2B means plus