Skip to content

Request charset defaults to UTF-8, Response charset defaults to ISO_8859_1 #300

Closed
@edatkinvey

Description

@edatkinvey

Both the request and response objects should default to the same charsets. This causes very hard to troubleshoot bugs with repeated requests.

from com.google.api.client.http.HttpResponse

public Charset getContentCharset() {
    return mediaType == null || mediaType.getCharsetParameter() == null
        ? Charsets.ISO_8859_1 : mediaType.getCharsetParameter();
}

from com.google.api.client.http.AbstractHttpContent

protected final Charset getCharset() {
    return mediaType == null || mediaType.getCharsetParameter() == null
        ? Charsets.UTF_8 : mediaType.getCharsetParameter();
}

Ideally both will use Charsets.UTF_8, as Charsets.ISO_8859_1 only supports a subset.

Metadata

Metadata

Assignees

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions