Skip to content

Conversation

@jclab-joseph
Copy link
Contributor

@jclab-joseph jclab-joseph commented Feb 8, 2025

Do not use new StringEntity without specifying a ContentType.

All non-English characters, are broken because of the code below.

TEXT_PLAIN = create("text/plain", Consts.ISO_8859_1);
DEFAULT_TEXT = TEXT_PLAIN;
public StringEntity(String string) throws UnsupportedEncodingException {
    this(string, ContentType.DEFAULT_TEXT);
}

ContentType.APPLICATION_JSON uses UTF-8.

Copy link
Collaborator

@jaycee-li jaycee-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@jaycee-li jaycee-li merged commit 09329f7 into googleapis:main Feb 10, 2025
2 checks passed
copybara-service bot pushed a commit that referenced this pull request Feb 10, 2025
FUTURE_COPYBARA_INTEGRATE_REVIEW=#56 from jclab-joseph:fix/request-encoding 9d24c42
PiperOrigin-RevId: 725317115
copybara-service bot pushed a commit that referenced this pull request Feb 11, 2025
FUTURE_COPYBARA_INTEGRATE_REVIEW=#56 from jclab-joseph:fix/request-encoding 9d24c42
PiperOrigin-RevId: 725317115
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

Successfully merging this pull request may close these issues.

2 participants