Details
Description
There is a http response with 500 status and error message encoded in UTF-8 in ContentBody, but without ContentType header.
When using EntityUtils.toString to get message like:
EntityUtils.toString(response.getEntity(), "UTF-8")
the defaultCharset will never work.
The real charset becomes ISO_8859_1 because ContentType.getOrDefault(entity) will return a ContentType holding a never null charset(ISO_8859_1). It can not be overrided by defaultCharset anymore.
Attachments
Issue Links
- is duplicated by
-
HTTPCORE-329 EntityUtils.toString uses wrong charset if no content-type is provided by server
-
- Closed
-