Skip to content
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

UTF-8 characters are unescaped even if they were escaped in response #745

Open
Katzen-Gott opened this issue Sep 19, 2016 · 11 comments
Open

Comments

@Katzen-Gott
Copy link

Katzen-Gott commented Sep 19, 2016

I have a service that returns an xml containing, among others, value CALLE MARÍA LOZANA, but in prettyPrint() I see CALLE MARÍA LOZANA. And object I get from response via JAXB also has CALLE MARÍA LOZANA for this field. But every other http client (postman, soapUI, curl) show escaped symbol (Í, not Í). So, what restassured shows happens to be different from what there really is. The my service's behaviour is definitely a bug, so I need to see such things and to be able to check for them, and that is impossible with restassured unescaping things that are escaped.

For those who might think that problem is in other clients: there is another service that returns values with diacritic signs, and for that service all http clients (postman, soapUI, curl) show that symbols are not escaped.

@johanhaleby
Copy link
Collaborator

What version of rest assured are you using?

@Katzen-Gott
Copy link
Author

Katzen-Gott commented Sep 21, 2016

3.0.0
Sorry, i didn't notice github changed characters, I made changes to issue formatting.

@johanhaleby
Copy link
Collaborator

Hmm... It's strange that you also get the same problems if you use Jersey. Could it be a JVM setting? I always start my JVM with java -Dfile.encoding=UTF-8 .... Could this be the issue?

@Katzen-Gott
Copy link
Author

I usually run my tests from IDEA, and I don't know what settings it uses, but I specified that option in run properties, and I got the same as previously.
Just to be sure that we understand each other correctly: restassured is giving me nice human-readable symbols (including symbols with diacritics). The problem is that service I call via restassured actually responds with escaped symbols (like Í). And I need to know that it returned these ugly things, but restassured hides this, it only shows Í no matter what was in service response, Í or Í

@johanhaleby
Copy link
Collaborator

Ah ok then I misunderstood you. Isn't the server also returning a charset? What does wireshark show you?

@Katzen-Gott
Copy link
Author

Just checked: server is returning charset UTF-8

@johanhaleby
Copy link
Collaborator

Hmm ok, I'm not sure what to make of this. Maybe it's the JVM that does this automatically?!

@Katzen-Gott
Copy link
Author

Then it's strange that SoapUI shows it differently, as it is a Java application. Do you know how to check if it's JVMs fault?

@johanhaleby
Copy link
Collaborator

Ah OK, I confused SoapUI with Postman. Then I'm not sure what could be the cause of this. Something with Apache HTTP Client perhaps?

@Katzen-Gott
Copy link
Author

Is there a way to check? I would post them a bug if it's their issue.

@johanhaleby
Copy link
Collaborator

The only way I can think of to check this would be to try to make the same request using vanilla Apache Http Client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants