ksye1773 Posted July 31, 2008 Share Posted July 31, 2008 function HTMLSafeToUnicode(line, ishex) { var re = new RegExp('&#([0-9A-Fa-f]{2,4});'); var m = re.exec(line); while (m != null) { var re2 = new RegExp('&#'+m[1]+';','g'); line = line.replace(re2, String.fromCharCode(ishex==true?h2d(m[1]):m[1])); m = re.exec(line); } return line; } Quote Link to comment Share on other sites More sharing options...
effigy Posted July 31, 2008 Share Posted July 31, 2008 html_entity_decode Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.