-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Open
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: waiting-for-feedbackWe need additional information before we can continueWe need additional information before we can continuestatus: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided on
Description
When a global exception is caught via @RestControllerAdvice and a ResponseEntity is returned,
HttpServletResponse.getCharacterEncoding() returns UTF-8 in Spring Boot 3,
but returns ISO-8859-1 in Spring Boot 4.
springboot 3 config:
server:
servlet:
encoding:
charset: utf-8
enabled: true
force-response: truespringboot4 config:
spring:
servlet:
encoding:
charset: utf-8
enabled: true
force-response: trueMinimal example program:
- Minimal example program for Spring Boot 3: spring-boot-3
- Minimal example program for Spring Boot 4: spring-boot-4
Steps to run:
- Start the Spring Boot application by running the
com.lwd.Main.main()method - Access the endpoint
http://127.0.0.1:8080/test
In Spring Boot 3, the following log can be seen in the console:
2026-01-14T02:03:10.342+08:00 INFO 137476 --- [nio-8080-exec-1] com.lwd.LogFilter : charSet:UTF-8
In Spring Boot 4, the following log can be seen in the console:
2026-01-14T02:03:38.296+08:00 INFO 118412 --- [nio-8080-exec-2] com.lwd.LogFilter : charSet:ISO-8859-1
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: waiting-for-feedbackWe need additional information before we can continueWe need additional information before we can continuestatus: waiting-for-triageAn issue we've not yet triaged or decided onAn issue we've not yet triaged or decided on