Admit me describe my questions in situation-oriented way:
Assume Internet Explorer is still the dominating web browser (Firefox has document for binary processing):
The XMLHttpRequest.responseText or XMLHttpRequest.responseXML in Internet Explorer desire txt or xml/xhtml/html, but what about the server response the xmlHttprequest with MIME TYPE application/octet? Would the characters in the response string all be less than 256? (every character of that string < 256)? Thanks very much for a straight answer, I have no webserver environment, so I don't know how to test it out.
Because use of txt or xml have an issue of character set encoding, and I don't know how to process #[[[CDDATA node of one encoded xml (for example: UTF-8, ASCII, GB18030) with JavaScript, when I getNodeText, does the docObj return me byte or decoded char? If it was decoded char which according to the header indicated charSet in the httpresponse, it would be all wrong.
To avoid mess up with charSet, I would like the server to response octet data and force strings data to be encoded as UTF-8 but another charSet in the binary format.
If the response is octal, so I guess the browser would not try to decode the response "txt".
Does this weird? Or miss understanding the fundamental things?
EDIT: I believe the question is asking this: Can JavaScript safely process strings that aren't encoded in Unicode? What are the problems with trying to do so?
EDIT: no no no , I mean if http-header: content-type is "application/octet", would Internet Explorer try to decode it as (16 bits Unicode or Internet Explorer local setting charset) when I get XMLHttpRequestobj.responseText use JavaScript? Or it (Internet Explorer) just wrap every single byte of the response body as a JavaScript string, then every character in that string less than or equal 256 (character <= 256).
Am I talking Mars language? Sadly, if I were Marsian, I would come as tourist without fuzzy questions. However I am in a country which share at least one property with Mars: RED.