Flag HTML response as "HTML document". Set encoding also for XML. https://www.w3.org/Bugs/Public/show_bug.cgi?id=23234