Indrek Ots
by Indrek Ots
~1 min read

Categories

  • articles

Tags

  • spring
  • java
  • ascii
  • apache commons
  • utf-8

Notice! This post is more than a year old. It may be outdated.

When posting a form as multipart/form-data, I encountered a situation where UTF-8 characters got garbled. I was using Spring’s CommonsMultipartResolver. The trick that solved it for me was to set the character set for multipartresolver bean.

<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
	<property name="defaultEncoding" value="UTF-8"/>
</bean>