[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleg Kalnichevski resolved HTTPCLIENT-2224.
-------------------------------------------
    Resolution: Invalid

`CharCodingConfig` allies to HTTP/1.1 connection encoding (message headers and 
trailers). This configuration has no bearing on message content encoding, which 
is governed by `Content-Type` header.

Oleg

> 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: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to