I get this type of coded message from a .net webservice that I need that I need to decode in javascript, any idea what type it is?
\u05d8\u05d9\u05d5\u05d8\u05d0
I get this type of coded message from a .net webservice that I need that I need to decode in javascript, any idea what type it is?
\u05d8\u05d9\u05d5\u05d8\u05d0
These are the Unicode representations of Hebrew characters.
Try this :-
var x = "\u05d8\u05d9\u05d5\u05d8\u05d0";
var r = /\\u([\d\w]{4})/gi;
x = x.replace(r, function (match, grp) {
return String.fromCharCode(parseInt(grp, 16)); } );
x = unescape(x);
console.log(x);
You can see the corresponding Hebrew text in the console.
\u05d8\u05d9\u05d5\u05d8\u05d0
this is "unicode-escape-sequence" in dotnet and above code is some uniode characters.
To know more about dotnet unicode escape sequence please refer below link.
https://msdn.microsoft.com/en-us/library/aa664669(v=vs.71).aspx
There is some recommended way of decoding unicode characters in javascript.Please refer below link
http://ecmanaut.blogspot.ca/2006/07/encoding-decoding-utf8-in-javascript.html