-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8315dc5
commit d028c49
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d028c49
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.
This is changed
request_body.encoding
from#<Encoding:UTF-8>
to#<Encoding:ASCII-8BIT>
.Is it intentional?
d028c49
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 don't think so. I wonder if
+''
keeps the original encoding?d028c49
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.
@znz @technicalpickles
This was a surprise to me as well, but I believe it turned out for the better since the response body encoding is now preserved. Unless I'm overlooking something, is there a specific reason the response body should be encoded as utf8, despite the parts were encoded as ascii? The provided code snippets demonstrate the observed behavior.
d028c49
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.
sorry, @znz you are right. if parts are already utf8, then this will return the body as ascii, since String.new produced ascii encoded string by default.
d028c49
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 have applied a fix that preserves the request body encoding 4489297 Thank you for reporting @znz