I open a webpage in IE9 - and all of a sudden the document mode switches to Quirks mode. The page itself is dead simple - no doctype, no meta tag, just a piece of (test purp
Have you tried explicitly setting compatibility in the HTML you generate?
HTML5 doctype putting IE9 into quirks mode?
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
..
As no one jumps up to the occasion, I will answer the question myself.
As paulsm4 indicated in comment to the question, it's the missing doctype which triggers quirks mode. See http://hsivonen.iki.fi/doctype/ for an excellent overview of doctypes, browser types and resulting browser modes.
With respect to the funny string of Asian characters - I did some further research on this and discovered where it comes from. I opened a new file in UltraEdit, converted it from utf-8 to unicode first and then copied the text. The result in hex view reveals it all:
As we see, it's just the xml file uploaded, plus a preceding byte order mark FF FE, which according to wikipedia is a utf-16 Little Endian one:
Now for the messages in the console: the order of events in the browser is apparently as follows: