The problem you are facing can be solved as follows:
const queryString = require('query-string')
const seacrh=queryString.stringify(params)
the above line expresses search=?foo=bar&data=1%0C2%0C3&data2=4%0C5%0C6
To remove an illogical character, simply decrypt the URL using the lines of code below
const search1=decodeURIComponent(seacrh);
DecodeURIComponent decodes these illogical strings.
source
share