Skip to content

PrintingResultHandler in MockMvc should infer UTF-8 encoding for JSON response #27926

Closed
@sbrannen

Description

@sbrannen

As explained in #27846 (comment), the PrintingResultHandler does not infer UTF-8 encoding for a response with content type application/json. Consequently, UTF-8 characters in such a response will be garbled in the output from the PrintingResultHandler.

Since PrintingResultHandler is effectively a client of the application (similar to the role a web browser plays), the PrintingResultHandler should infer the response encoding to be UTF-8 if the content type is application/json.

Metadata

Metadata

Assignees

Labels

in: testIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions