When I read an UTF-8 encoded template with FreeMarker, special chars are rendered correctly in the browser, although freeMarkerConfig.getDefaultEncoding()
returns "Cp1252". If I set freeMarkerConfig.setDefaultEncoding("UTF-8")
, I see only question marks in the browser, although "UTF-8" is the actual encoding of the template file. In every case the http header "Content-Type: text/html; charset=UTF-8" is sent.
Any idea what is wrong?