Character set problem when uploading a file

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>
comments powered by Disqus