Fixed encoding of JavaScript redirect URLs