Click to See Complete Forum and Search --> : Forcing UTF8?
FredAt
02-11-2007, 12:47 PM
When I prepare an XML document in JS using the various XMLDOM methods and then use XMLHttpRequest to POST it to a server is there some way I could persuade the browser to always send out the document in UTF8 format - even when it might have otherwise have determined that plain ASCII would suffice?
Charles
02-11-2007, 02:11 PM
Plain ASCII is utf-8.
FredAt
02-11-2007, 03:17 PM
Plain ASCII is utf-8.
Perhaps I did not phrase my question too well. Plain ASCII is UTF-8 but UTF-8 is a superset of ASCII and can be made up of 1 to 4 bytes. I guess what I am trying to say is that when I get XML pumped out of browser can I always be sure that it will be in UTF-8 format (as opposed to UTF-16, for instance).
The point is this - in my server side code I want to be able to treat the XML as being in UTF-8 without any further testing. If it happens to be ASCII that is still OK. If, OTH, it is in UTF-16 on some occassions and UTF-8 at other times then I have more work to do.
Hope this makes my question clearer. I have to admit that my understanding of UTF variants is less than perfect.