• server.servlet.encoding.force, server.servlet.encoding.force-request, server.servlet.encoding.force-response
    • HttpEncodingAutoConfiguration applies them to auto-configured CharacterEncodingFilter
      • affects any servlet web app, not just an embedded web server
  • server.servlet.encoding.charset
    • HttpMessageConvertersAutoConfiguration applies it to auto-configured StringHttpMessageConverter
      • affects reading or writing of Strings during blocking HTTP exchanges (Spring MVC, RestTemplate, RestClient)
    • HttpEncodingAutoConfiguration applies it to auto-configured CharacterEncodingFilter
      • affects any servlet web app, not just an embedded web server
  • server.servlet.encoding.mapping
    • HttpEncodingAutoConfiguration applies it to ConfigurableServletWebServerFactory
      • affects servlet web apps using an embedded web server

Prior to https://github.com/spring-projects/spring-boot/issues/18827, properties were all named spring.http.encoding.*.. I think we need to move to somewhere between the two extremes, perhaps the following:

spring.servlet.encoding.charset
spring.servlet.encoding.force
spring.servlet.encoding.force-request
spring.servlet.encoding.force-response

spring.http.converters.string-encoding-charset

server.servlet.encoding.mapping

I'm unsure about both spring.servlet.encoding.charset and spring.http.converters.string-encoding-charset. The former should be applied to the auto-configured CharacterEncodingFilter that applies to all servlet web apps. The latter would be applied to the auto-configured StringHttpMessageConverter that applies to any blocking HTTP exchange using Spring MVC, RestTemplate, or RestClient. Having two properties that will have the same value the vast majority of the time is not ideal.

Comment From: wilkinsona

We're going to go with the two properties for now. We can then review all the various encoding properties that we have separately and consider some consolidation.