Christopher G. Stach II created HTTPCORE-299:
------------------------------------------------
Summary: o.a.h.entity.ContentType should rely on Charset.name()
instead of Charset.toString() for building header
Key: HTTPCORE-299
URL: https://issues.apache.org/jira/browse/HTTPCORE-299
Project: HttpComponents HttpCore
Issue Type: Bug
Components: HttpCore
Affects Versions: 4.2
Reporter: Christopher G. Stach II
Other than relying upon toString for functional code being a bad idea, the
java.nio.charset.Charset API contains the name() method for retrieving the
canonical name (ContentType.java:118). At least on Android, Charset.toString()
returns the class name and the canonical name. This makes the new API from
HTTPCORE-297 somewhat broken, as you'll still need to rely on the recently
deprecated StringEntity API, like the following, in order to get a header that
works:
new StringEntity(str, contentType.getMimeType(),
contentType.getCharset().name())
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]