Affects: 5.x, 6.x


The default was changed for RestClientResponseException in https://github.com/spring-projects/spring-framework/pull/23764

org.springframework.web.reactive.function.client.WebClientResponseException still defaults to ISO-8859-1.

``` /* * Return the response content as a String using the charset of media type * for the response, if available, or otherwise falling back on * {@literal ISO-8859-1}. Use {@link #getResponseBodyAsString(Charset)} if * you want to fall back on a different, default charset. / public String getResponseBodyAsString() { return getResponseBodyAsString(StandardCharsets.ISO_8859_1); }

Shouldn't this also be changed to UTF-8?

Shouldn't org.springframework.web.reactive.function.client.DefaultClientResponse#createException have UTF-8 as default Charset for Responses of type "application/json"? Currently its null. 

Charset charset = headers().contentType().map(MimeType::getCharset).orElse(null); ``` This could also solve the problem.