I have lots of characters in the form ¶
which I would like to display as unicode characters in my text editor.
This ought to convert them:
var newtext = doctext.replace(
/&#(\d+);/g,
String.fromCharCode(parseInt("$1", 10))
);
But doesn't seem to work. The regular expression /&#(\d+);/
is getting me the numbers out -- but the String.fromCharCode
does not appear to give the results I'd like. What is up?