hi, im using Google Translate API, and if i try to translate Mc Donald's this is what i get as a result:
Mc Donald's
How can i translate '
to '
-- in Javascript -- and so on for any other numeric character reference?
Thanks!
hi, im using Google Translate API, and if i try to translate Mc Donald's this is what i get as a result:
Mc Donald's
How can i translate '
to '
-- in Javascript -- and so on for any other numeric character reference?
Thanks!
Shouldn't something like this do it?
'Mc Donald's'.replace(/&#(\d+);/g, function(m, g) {
return String.fromCharCode(g);
});
JS libraries often have helper api's for this, Prototype for example has its unescapeHTML() function on String that works perfect, notice the examples: