I have used escape function of java script to encode a java script string. But the result appears to be weird one which consists of the following characters:
%3CBitte%20w%E4hlen%3E
…for the string:
Bitte wählen
…which is a German sentence. I need the output as Bitte wählen.
The following code may help you understand clearly
var temp = escape(String(<Bitte wählen>));
It’s not really clear what you mean.
To escape any character in JavaScript, read up on JavaScript character escape sequences, or just use mothereff.in/js-escapes. That page tells you that in JavaScript,
'Bitte wählen'can be written as'Bitte w\xe4hlen'or even'\x42\x69\x74\x74\x65\x20\x77\xe4\x68\x6c\x65\x6e'.