Skip to content

fix: Set request content-type encoding to UTF-8 - #56

Merged
jaycee-li merged 1 commit into
googleapis:mainfrom
jclab-joseph:fix/request-encoding
Feb 10, 2025
Merged

fix: Set request content-type encoding to UTF-8#56
jaycee-li merged 1 commit into
googleapis:mainfrom
jclab-joseph:fix/request-encoding

Conversation

@jclab-joseph

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

Copy link
Copy Markdown
Contributor

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.

@jaycee-li jaycee-li left a comment

Copy link
Copy Markdown
Collaborator

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
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