Skip to content

RestClient message converters unable to parse ISO-8859-1 response #34745

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

Open
pax95 opened this issue Apr 12, 2025 · 0 comments
Open

RestClient message converters unable to parse ISO-8859-1 response #34745

pax95 opened this issue Apr 12, 2025 · 0 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: waiting-for-triage An issue we've not yet triaged or decided on

Comments

@pax95
Copy link

pax95 commented Apr 12, 2025

Hi

I have created a Stackoverflow with the details here https://stackoverflow.com/questions/79568225/restclient-message-converters-unable-to-parse-iso-8859-1-response-from-remote-se

It seems that setting the DefaultCharset on RestClient messageconverters doesn't have any effeft when marshalling a iso-8859-1 response.

Currently the workaround is to take the response as a string and then manually unmarshall to jaxb objects

var xml = woRestClient.get()
            .uri("myuri")
            .retrieve()
            .body(String.class);
        var programs = JaxbUtils.unmarshall(xml, Programs.class);

There is a simelar question here https://stackoverflow.com/questions/77663426/restclient-how-to-correctly-unmarshall-text-xml-response

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 12, 2025
@pax95 pax95 changed the title RestClient message converters unable to parse ISO-8859-1 response from remote server RestClient message converters unable to parse ISO-8859-1 response Apr 12, 2025
@sbrannen sbrannen added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Apr 15, 2025
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: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

No branches or pull requests

3 participants