Skip to content
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

respect text encoding specified in argument #20999

Merged
merged 2 commits into from
Oct 5, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update
  • Loading branch information
xiangyan99 committed Oct 1, 2021
commit acb95bee0da76842f1a10aac012faa1a8b40258b
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def text(self, encoding: Optional[str] = None) -> str:
)
else:
encoding = chardet.detect(body)["encoding"]
if not encoding:
if encoding == "utf-8" or encoding is None:
encoding = "utf-8-sig"

return body.decode(encoding)
Expand Down