New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Posted forms are decoded with ISO-8859-1 instead of UTF-8 #3912
Comments
Not knowingly. Can you share a sample project that reproduces the problem? |
Our project is public: https://github.com/dzhw/metadatamanagement You can see the described behavior here https://metadatamanagement.cfapps.io/en/variables/create if you put an 'Ü' in label and submit the form. |
Thanks. And thanks, too, to @timtebeek. Unfortunately, the changes made in 2b3d419 have altered the ordering of the auto-configured filters. In M4 the ordering was:
In M5 the ordering is:
A workaround is to declare your own @Autowired
private HttpEncodingProperties httpEncodingProperties;
@Bean
public OrderedCharacterEncodingFilter characterEncodingFilter() {
OrderedCharacterEncodingFilter filter = new OrderedCharacterEncodingFilter();
filter.setEncoding(this.httpEncodingProperties.getCharset().name());
filter.setForceEncoding(this.httpEncodingProperties.isForce());
filter.setOrder(Ordered.HIGHEST_PRECEDENCE);
return filter;
} |
@dsyer I'm not sure of your motivations for moving |
Don't think so. |
Thanks for the immediate feedback. We will go with the workaround for the time being and upgrade to 1.3.0.RC1 as soon as it is available. |
* Should address: spring-projects/spring-boot#3912
but , why I meet the same problem like it in 1.5.8.RELEASE??? |
@lewinras It’s impossible to say without more information. If you believe you’ve found a bug then please open a new issue with a minimal sample project that reproduces the problem. |
@wilkinsona I was wondering if this bug still exists as I encountered it in my project. sending |
As far as we know, this bug is fixed. You haven't said which version you're using, but if you're on 2.0 then please be aware of #11607. |
Good day. The problem is relevant again. Spring Boot 2.7.3 + Mustache. Solved by installing an encoder (not ordered). But after adding Spring Security to the project, the order apparently changes, as described above. This code works: import org.springframework.boot.web.servlet.filter.OrderedCharacterEncodingFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import static org.springframework.core.Ordered.HIGHEST_PRECEDENCE;
@Configuration
public class FiltersUTF8Config {
@Bean
// https://github.com/spring-projects/spring-boot/issues/3912
public OrderedCharacterEncodingFilter setUTF8OrderedCharacterEncodingFilter() {
var filter = new OrderedCharacterEncodingFilter();
filter.setEncoding("UTF-8");
filter.setForceEncoding(true);
filter.setOrder(HIGHEST_PRECEDENCE);
return filter;
}
} |
@Dmitrii-Iakovenko Can you please open a new issue with a minimal sample that reproduces your problem? |
Hi,
after upgrading from 1.3.0.M4 to 1.3.0.M5 form parameter if sent with a POST seem to be decoded with ISO-8859-1 instead of UTF-8. Have there been any changes?
The text was updated successfully, but these errors were encountered: