I want to display some Unicode Entities (arond U+2650, some graphical symbols) but I can’t get them to display in the browser (tested FF, Safari)
what I have:
.html file (utf-8 encoded)
.js file (utf-8 encoded)
insert:
Expand|Select|Wrap|Line Numbers
- obj.symbol = "♜";
- // somewhere later in the code
- element.innerHTML = obj.symbol;
ex. "♜"
strangely enough, if I select and copy-paste the text into my editor, I get the character as if nothing had happened. ah, yes, and of course the ACSII and ISO range values all work (e.g. 252).
if I use
Expand|Select|Wrap|Line Numbers
- obj.symbol = "&#9820";
- // somewhere later in the code
- element.innerHTML = obj.symbol;
there’s (possibly) one kind of solution, though. MDC has a String.fromCharCode() fix for UTF-16. it could work for multibytes as well (if you change the base values … which I don’t know).
can anyone help me fix that problem?
thanks