For my application in Javascript, I have to construct a URL which contains a param called 'name', whose value contains few special characters like
'.', '(', ')', '|', '#', '^', ',' etc
Eg: ../app/quest?name=list#2|#3
Due to some application restrictions, I have to encode only the special characters '|' and '^' in the name value.
I replaced '|' in "list#2|#3" with its encoded value "%7C" as "list#2%7C#3" and updated the URL using history.replaceState(stateObj, unused, url). But the value is not encoded and is passed as "list#2|#3" only.
How can forcefully pass the value in its encoded format itself ?