How to decode HTML entities for XHTML application?
For example, $("<div/>").html("·").text() will raise an JavaScript error.
Error is:
[Exception... "An invalid or illegal string was specified" code: "12" nsresult: "0x8053000c (SyntaxError)"
EDIT: XHTML means real XHTML application, with application/xhtml+xml Content-type.
You can either use
document.createEntityReferenceor escape the characters unsuitable for your file encoding at JavaScript code’s level (\uxxxx); but, as pointed in your comment,document.createEntityReferencedoesn’t work on Firefox: https://developer.mozilla.org/fr/docs/DOM/document.createEntityReferenceAlternatively, you can use a custom library such as php.js’s
html_entity_decode: http://phpjs.org/functions/html_entity_decode/