I am facing an issue with my JS (Angular) app where I load parameters from the URL fragment after the # sign. These parameters contain JSON objects, like this example:
...#filters={"Course":["ST_12.+13.12.2016 [Basel]"]}
The aim is to open a data-grid and pre-filter some of the data, making the object quite generic. However, the problem arises when any string like this gets converted to:
filters=%7B%22Course%22:%5B%22ST_12.+13.12.2016+%5BBasel%5D%22%5D%7D
resulting in:
...#filters={"Course":["ST_12. 13.12.2016 [Basel]"]}
It loses the + and replaces it with a space. One solution would be to encode the + character as %2b, like so:
filters=%7B%22Course%22:%5B%22ST_12.%2B13.12.2016+%5BBasel%5D%22%5D%7D
but unfortunately, this approach fails. As soon as you input this into a browser (Chrome/Firefox), the %2b gets decoded back into a + directly in the URL field, causing the original issue to resurface.
I have researched online but most responses deal with basic queries regarding why spaces need to be encoded as + symbols. My concern lies in passing a normal string value that includes actual text along with + characters reliably.