Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
4.0 Final
-
None
-
all
Description
UrlEncodedFormEntity sets the Content-Type header to:
"application/x-www-form-urlencoded"
It should set the header to:
"application/x-www-form-urlencoded; charset=" + charset
As a result, content can be misinterpreted by the recipient (e.g. if the entity content includes multibyte Unicode characters encoded with the "UTF-8" charset).
For a correct example of specifying the charset in the Content-Type header, see StringEntity.java.
Here's the fix:
public UrlEncodedFormEntity (
final List <? extends NameValuePair> parameters,
final String encoding) throws UnsupportedEncodingException
public UrlEncodedFormEntity (
final List <? extends NameValuePair> parameters) throws UnsupportedEncodingException