I can't change the encoding to UTF-8, even if I explicitly specify it. Page in browser always created with encoding ISO-8859-1 and my language symbols show as "???". If it important - i'm use IntelliJ IDEA.
It's problem with freemarker because when I change it to jsp, pages generate with encoding UTF-8.
I tried to change encoding with:
- Check encoding in IDE
- <#ftl encoding>
- <#setting url_escaping_charset="UTF-8">
- <#setting output_encoding="UTF-8">
- specify
producesparameter in @....Mapping annotations - Specify encoding in
FreeMarkerConfigurer - Specify content type in
FreeMarkerResolver - Specify encoding in
CharacterEncodingFilter - Specify encoding in implementation of
Filter - Specify content type in
FreeMarkerConfigurerFactory
But nothing of it didn't give me a solution
java.io.Writer, and that's always UTF-16. It's the embedding framework/application that provides thatWriter. As it will be a HTTP response in your case, at some later point the Servlet implementation will do the encoding, certainly to the charset set as the encoding of theHttpServletResponse. FreeMarker doesn't set that, as it's not dependent on Servlets. So it's a generic Servlet and/or Spring Web setting, not a FreeMarker one. - ddekany