js url encode

JavaScript
var urlVar = encodeURI("This text can be passed on a url now");var encodeURI = encodeURIComponent("&")The encodeURIComponent() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.
console.log(encodeURIComponent('?x=test'));
// expected output: "%3Fx%3Dtest"# -r enable raw output

jq -r .[0].string FILE.json
Source

Also in JavaScript: