Re: Browser Converts No ASCII for JS Text Node or any Text Attribute



vunet.us@xxxxxxxxx wrote:

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";
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?

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.



--

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



Relevant Pages

  • Re: javascript and XML help
    ... Some Text and html tags ... That is not well-formed XML so any XML parser will give a parse error. ... You need to be aware however that such an XML parsing will give you XML DOM nodes, it does not help that some of them might have the same tag name as HTML elements e.g. ...
    (comp.lang.javascript)
  • Re: Java script problem
    ... Understand that an XML parser cannot care about this. ... even a HTML UA MUST NOT care about this if the encoding specified ... with the Content-Type HTTP header is different; ...
    (comp.lang.javascript)
  • Re: Java Regex Problem
    ... an XML parser and trying to locate particular nodes. ... For the HTML I'm parsing, there won't be any nested list items. ... task, despite the real risks you identified (which, BTW, I've already ...
    (comp.lang.java.programmer)
  • Re: How to read contents of html table with .net?
    ... JS> I have a need to read the contents of an html table on a remote web ... Beware that most web pages aren't written with well formed, valid XML (HTML ... The XML parser might not work in that case. ... Googling for "screen scraping .NET" should get you some alternatives. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Java Regex Problem
    ... problem, since list-items in HTML can be nested, e.g. ... <exampleHtmlSnippet> ... Generally yes I would use an XML parser but I don't think the HTML will ...
    (comp.lang.java.programmer)