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
feat: PostResponse
supports charset other than UTF-8
#239
Conversation
PostResponse
supports charset other than UTF-8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the contribution, please add some test cases for the change.
Added test cases. Thank you. |
@@ -53,7 +57,7 @@ public ByteBuffer encode() { | |||
|
|||
int bodyIndex = -1; | |||
if (StringUtils.hasText(body)) { | |||
byte[] bodyBytes = body.getBytes(StandardCharsets.UTF_8); | |||
byte[] bodyBytes = body.getBytes(charset); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
byte[] bodyBytes = body.getBytes(charset); | |
byte[] bodyBytes = body.getBytes(this.charset); |
should be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reflected your review. Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@joyyir thanks! |
Please answer these questions before submitting a pull request
Why submit this pull request?
Bugfix
New feature provided
Improve performance
Related issues
request help:
PostResponse
supports charset other thanUTF-8
#238Bugfix
Description
How to fix?
New feature or improvement
Describe the details and related test reports.
PostResponse
by default converts the body to bytes inUTF-8
.It would be nice to support other charsets.
Source branch
main
Related commits and pull requests
Target branch
main