I am trying to submit a form, which has UTF8 characters inside it. The form looks like this:
<form id="workflowPersistForm" accept-charset="UTF-8" method="post" action="/workflow-next">>
<input id="stateGlobal" type="hidden" value=" お問い合わせ" name="state">
</form>
My server is a spring based. My web.xml already has the Encoding Filter:
<filter>
<filter-name>EncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
The problem is that the UTF-8 characters are getting messed up somewhere. I put a break point just at the start of controller, and the characters are messed up at that point itself. Also, if I generate UTF8 characters inside Controller, it gets rendered correctly in the browser. Just that on form post, the controller doesn't receive the characters properly.
Any idea what I might be doing wrong?
Edit: Looks like, in the new page data is not messed up, but its double encoded. I am unable to understand why it is double encoded.
Edit 2: When I change the form to get instead of post, everything works perfectly. I have no idea what post is breaking.