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

header encoding issues #516

Closed
cmorin6 opened this issue Jun 3, 2014 · 4 comments
Closed

header encoding issues #516

cmorin6 opened this issue Jun 3, 2014 · 4 comments

Comments

@cmorin6
Copy link

cmorin6 commented Jun 3, 2014

Hi,

When passing headers parameters containing a 'é' it is received on server side as 'é'.
It might seem wird to pass such chars as arguments but I can't modify server side.
I know this behaviour is specific to retrofit because it worked with the old client using HttpUrlConnection and it also works with Postman chrome plugin.

I don't know if this bug comes from retrofit itself or from the underlying okhttpClient i'm using.

I've tried with the folowing versions
retrofit : 1.5.0 & 1.5.1
okhttp : 1.5.4 , 1.6.0 & 2.0.0-RC1

I hope this might help.

@artworkad
Copy link

@JakeWharton #513 may be related?

@JakeWharton
Copy link
Collaborator

Reproduced this. Investigating now.

@JakeWharton
Copy link
Collaborator

According to RFC 2616 (HTTP) headers use the ISO-8859-1 character set. Alternate character sets can be used if they are encoded using RFC 2047. When using the Apache client it seems to be working (using MockWebServer) but both OkHttp and UrlConnection clients get the garbled characters like you saw.

We need to figure out the right owner of handling the encoding here. Since the Apache client already supports it I'm inclined to say that we should add it to OkHttp. I need to have a chat with some people internally before we can move forward.

You can see the code I was playing with here: https://github.com/square/retrofit/compare/jw;broken-header-encoding

@JakeWharton
Copy link
Collaborator

Moved to OkHttp.

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

3 participants