I'm developing a web application in Spring Framework under Wildfly 10 application server. I use Eclipse IDE.
I experienced problems with the character encoding which I wasn't able to solve: some of the characters doesn't appear properly when I send them from server side to client side.
My test String
object I use is "árvíztűrő tükörfúrógép
"
- When I read the value from database and send it to the client side, everything appears fine.
- When I set the String value in the Controller as a ModelAndView object, it appears as '??rv?zt?±r?? t??k?¶rf??r??g?©p'
- When I send the value from client side by ajax as a POST variable and send it back to client side, it appears as 'árvízt?r? tükörfúrógép'.
I set all the .jsp files encoding UTF8: <%@page contentType="text/html" pageEncoding="UTF-8"%>
In Eclipse I set all the Maven modules text file encoding to UTF8. All the files are in UTF8.
What did I miss? What else should I set to get the String
value right on client side? Should I set the character encoding in Wildfly 10 somehow?
Could somebody help me? If you need further information, please don't hesitate to ask. Thank you.
EDIT: Setting the character encoding as Maven property solved the second case. Now I only have problems with the third case:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>