-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Document server.servlet.encoding.* properties and server.servlet.encoding.mapping in particular #32472
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
Comments
Thanks for the sample. Unfortunately, I've been unable to reproduce the problem using the first commit in the repository. If I disable the auto-configuration of the I am on macOS which uses UTF-8 by default, but configuring the JVM to use US-ASCII (verified using |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
@lksh5737 As I described above, that doesn't match the behavior that I have observed. If you or @Dmitrii-Iakovenko can provide a sample that shows the problem, we can take another look. |
@lksh5737 Thanks, but that does not reproduce the problem for me either. It works fine for me on macOS, even when I force the JVM to use US-ASCII as its default encoding. As I asked above, what do I need to do so that the provided sample will reproduce the problem? |
Perhaps you can debug your application with Spring Boot 2.6 where it works and Spring Boot 2.7 where it does not to find the difference? Unfortunately, we're unlikely to be able to help any further without knowing how to reproduce the problem. |
It's hard to offer specific guidance as we don't know where the problem is. I would step through the code using your IDE's debugger to try to identify the point at which the UTF-8 characters are corrupted. The rendering of the |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
https://github.com/swhyeon98/mustache_with_springboot_test.git Can you find any errors on the above sample? There are two solutions for this issue. you can add the following tags to the application.properties file: Alternatively, you could downgrade your Spring Boot version to 2.6. Both methods have solved the issue. The followings are photos of the test run in different environments. ![]() |
@swhyeon98 Unfortunately, I cannot reproduce the problem with your sample either. I've tried on macOS using its default encoding (
|
@wilkinsona
|
I ran it in Eclipse and on the command line. On the command line, I built the jar and then ran it using |
@wilkinsona Thank you very much. I will try to find the difference between you and me and the cause (java version, etc.). If I find the cause, can I comment again then? |
Yes, of course. Please do. We'd really like to understand what's going on as I'm sure it'll help others. |
It's the same as it was with Looking at the headers in your request that's receiving an
I'm not yet sure why it has the effect that it does, but it gives me something to investigate. |
The problem is due to Tomcat's mapping of locales to charsets. Without an Tomcat provides a flag that can be used to disable its enforcement of the default character encoding but it doesn't really help. Not with
Instead, the problem can be addressed by mapping the
This property is equivalent to the Without this custom mapping, the same problem occurs with Jetty as it defaults to While |
Spring Boot 2.7.3
Repository demonstrating the issue + commit history.
Old similar problem - #3912
The text was updated successfully, but these errors were encountered: