Closed
Description
Adam Berlin opened SPR-11779 and commented
Our application needs to receive UTF-8 from forms, but out of the box our high byte characters were getting mutilated.
Digging through the stack, we found that by default our RequestMappingHandlerAdapter has a coyoteRequest (a couple layers down within other request wrappers) with tomcat http parameters with an encoding attribute of "ISO-8859-1".
We were able to solve this in our application by manually setting the encoding to UTF-8:
@Configuration
public class FilterConfig {
@Bean
public Filter encodingFilter() {
CharacterEncodingFilter encodingFilter = new CharacterEncodingFilter();
encodingFilter.setEncoding("UTF-8");
return encodingFilter;
}
}
We'd love it if the default encoding, instead of ISO-8859-1, were the more ubiquitous UTF-8.
Thanks,
taavo ([email protected]) & tim ([email protected])
Issue Links:
- PathVariable encoding fails if request charset is not set [SPR-11474] #16099 PathVariable encoding fails if request charset is not set