[
https://issues.apache.org/jira/browse/HTTPCLIENT-2224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17554132#comment-17554132
]
Michael Osipov commented on HTTPCLIENT-2224:
--------------------------------------------
There is a similar bugs for content types which do not have a charset
parameter, but the encoding is defined by the semantics of the content type and
JSON is exactly such a content type.
> US_ASCII used instead of charset configuration in CharCodingConfig
> ------------------------------------------------------------------
>
> Key: HTTPCLIENT-2224
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2224
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient (async)
> Affects Versions: 5.1.3
> Environment: Running on MacOS, EC2
> Reporter: Javed Bhayla
> Priority: Major
>
> Issue: “supplémentaires sur l'état relative à” shows up as “suppl��mentaires
> sur l'��tat relative ��” in the JSON response
> I have configured the async client to use UTF_8 using:
> CloseableHttpAsyncClient client = HttpAsyncClients.custom()
> .setCharCodingConfig(CharCodingConfig.custom().setCharset(UTF_8).build())
> .build()
> Making a request and calling “response.getBodyText()” results in US_ASCII
> being used instead of UTF_8 because the server returns the header
> “Content-Type: application/json” without the charset.
> If the server returns "Content-Type: application/json;charset=utf-8", then
> UTF-8 is used as expected.
> Should the CharCodingConfig setting be used as the default instead of
> US_ASCII in SimpleBody?
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]