Skip to content

Switch default to UTF-8 in RestClientResponseException #23764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ask4gilles
Copy link

closes #23738

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 7, 2019
@ask4gilles
Copy link
Author

Hi @sbrannen and @jhoeller ,
Sorry to ping but this one is a one liner which would prevent us writing a custom error handler, so if you would have a minute to have a look :) Thanks!

@rstoyanchev rstoyanchev changed the title defaults to UTF-8. Switch default to UTF-8 in RestClientResponseException Oct 15, 2019
@rstoyanchev rstoyanchev added type: task A general task in: web Issues in web modules (web, webmvc, webflux, websocket) status: waiting-for-triage An issue we've not yet triaged or decided on and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 15, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Oct 15, 2019

Note that the same decision also applies to the WebClient, in DefaultClientResponse#createException() which then determines the encoding for resulting WebClientResponseException.

@sdeleuze, @poutsma, following the change in #22788, JSON responses no longer specify a charset as per RFC 7159 defaulting to UTF-8. However client exceptions use ISO-8859-1 if no charset is specified. I suggest we switch the default to UTF-8 starting in 5.2 and also add an overloaded getResponseBodyAsString(Charset) to RestClientResponseException and WebClientResponseException starting in 5.1.x for additional control. WDYT?

@rstoyanchev
Copy link
Contributor

@ask4gilles please refrain from pings on issues like that. What may be a one-liner for you could become a time sink for others and for us if not carefully considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider defaulting to UTF-8 in RestClientResponseException
3 participants