If the response entity type is a String and the charset is not explicitly set, the String is converted to a byte[] using UTF-8. Since the default charset in HTTP is ISO-8859-1, the responses are invalid. Either, the conversion should use o.getBytes(StandardCharsets.ISO_8859_1) or the response charset should be set to utf-8 in that case.
I recommend to set "utf-8" charset.
This is violation of HTTP 1.1 specification, chapter "3.7.1 Canonicalization and Text Defaults":
The "charset" parameter is used with some media types to define the
character set (section 3.4) of the data. When no explicit charset
parameter is provided by the sender, media subtypes of the "text"
type are defined to have a default charset value of "ISO-8859-1" when
received via HTTP. Data in character sets other than "ISO-8859-1" or
its subsets MUST be labeled with an appropriate charset value. See
section 3.4.1 for compatibility problems.
- clones
-
RESTEASY-1565 Response is broken for String entities if charset is not explicitly specified
- Resolved
- is incorporated by
-
JBEAP-9973 Upgrade RESTEasy to 3.0.22.Final
- Closed
- relates to
-
RESTEASY-1622 Decrease log level of "lack charset" warning message
- Resolved
-
RESTEASY-1620 resteasy.add.charset property is not described in RESTEasy documentation
- Resolved
-
RESTEASY-1628 Response is broken for String entities if charset is not explicitly specified, Part 2
- Resolved
-
JBEAP-9316 Decrease log level of "lack charset" warning message
- Closed
-
JBEAP-9315 resteasy.add.charset property is not described in RESTEasy documentation
- Closed