From c6b86af78bbee96a799e27932d5a25e4a3b40576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Thu, 19 Oct 2023 12:58:09 +0200 Subject: [PATCH] Fall back on UTF-8 charset in WebClientResponseException Instead of ISO-8859-1, consistently with the change done in RestClientResponseException. Closes gh-31072 --- .../reactive/function/client/WebClientResponseException.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java index d6575fd528..80cf9bcc5b 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/client/WebClientResponseException.java @@ -35,6 +35,7 @@ import org.springframework.util.Assert; * Exceptions that contain actual HTTP response data. * * @author Arjen Poutsma + * @author Sebastien Deleuze * @since 5.0 */ @SuppressWarnings("RedundantSuppression") @@ -202,11 +203,11 @@ public class WebClientResponseException extends WebClientException { /** * 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 + * {@literal UTF-8}. Use {@link #getResponseBodyAsString(Charset)} if * you want to fall back on a different, default charset. */ public String getResponseBodyAsString() { - return getResponseBodyAsString(StandardCharsets.ISO_8859_1); + return getResponseBodyAsString(StandardCharsets.UTF_8); } /**