
Signature
Martin Honnen
http://JavaScript.FAQTs.com/
> vunet...@gmail.com wrote:
> > Browsers convert my ASCII fine when webpage is set to
[quoted text clipped - 22 lines]
> Martin Honnen
> http://JavaScript.FAQTs.com/
Yes, Unicode works well: document.createTextNode("\u00FC"). However,
my strings look like:
var myASCII = "Do not remove text ü and do not remove text,
blah blah";
document.createTextNode(myASCII);
and there are plenty of different strings containing all possible
ASCII values. What would you recommend in that case. Is it possible to
convert all ASCII to Unicode, then?
Martin Honnen - 29 Jun 2007 17:28 GMT
>> The ü syntax is a numeric character reference meant for an HTML
>> or XML parser. createTextNode does not do any HTML or XML parsing.
> var myASCII = "Do not remove text ü and do not remove text,
> blah blah";
[quoted text clipped - 3 lines]
> ASCII values. What would you recommend in that case. Is it possible to
> convert all ASCII to Unicode, then?
ASCII is a subset of Unicode. As said, ü is a numeric character
reference to be parsed by an HTML or XML parser. That has nothing to do
with ASCII. If you have such character references then you need to use
an HTML parser for instance by setting innerHTML of an HTML element node.

Signature
Martin Honnen
http://JavaScript.FAQTs.com/