hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kuyurmoe (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCORE-328) defaultCharset in EntityUtils.toString never works if there is no ContentType in a http response
Date Wed, 16 Jan 2013 10:42:14 GMT
kuyurmoe created HTTPCORE-328:
---------------------------------

             Summary: defaultCharset in EntityUtils.toString never works if there is no ContentType
in a http response
                 Key: HTTPCORE-328
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-328
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore
    Affects Versions: 4.2.3
            Reporter: kuyurmoe


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message