Skip to content

Deprecate MediaType.APPLICATION_JSON_UTF8 in favor of APPLICATION_JSON #22788

Closed
@reschke

Description

@reschke

In spring-framework/spring-web/src/main/java/org/springframework/http/MediaType.java:

 * <p>This {@link MediaType#APPLICATION_JSON} variant should be used to set JSON
 * content type because while
 * <a href="https://tools.ietf.org/html/rfc7159#section-11">RFC7159</a>
 * clearly states that "no charset parameter is defined for this registration", some
 * browsers require it for interpreting correctly UTF-8 special characters
  1. RFC 7159 has been obsoleted by RFC 8259
  2. That states "No "charset" parameter is defined for this registration. Adding one really has no effect on compliant recipients." (at the end of Section 11)
  3. ...and browsers have indeed fixed their code.

So it would be best to clarify the text and deprecate the constant.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions