[Repo Assist] Change HTTP response default encoding from ISO-8859-1 to UTF-8#1691
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
[Repo Assist] Change HTTP response default encoding from ISO-8859-1 to UTF-8#1691github-actions[bot] wants to merge 2 commits intomainfrom
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
…#1251) - ResponseDefaultEncoding changed from ISO-8859-1 to UTF-8 to match System.Net.Http.HttpClient behaviour - Update test to expect UTF-8 - Update Encoding parameter doc comments in type providers to remove the ISO-8859-1 reference - Add 9.0.0 release notes entry (breaking change: default encoding changes) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.
Implements the fix requested in #1251 — changes the HTTP response default encoding from ISO-8859-1 to UTF-8 to match
System.Net.Http.HttpClientbehaviour.This is a clean rebase of #1665 on the current
mainbranch (post-8.1.0 release). Please close #1665.Closes #1251
Root Cause
HttpEncodings.ResponseDefaultEncodingwas set to ISO-8859-1, following RFC 2616 §3.7.1. However, modern HTTP servers, browsers, andSystem.Net.Http.HttpClientall default to UTF-8 in practice when nocharsetis specified in theContent-Typeresponse header. This caused garbled characters when fetching UTF-8 content from servers that don't include an explicit charset.@dsymeendorsed this fix: "Agreed we should do the same as HttpClient and do this."Change
HttpEncodings.ResponseDefaultEncodingchanged fromEncoding.GetEncoding("ISO-8859-1")toEncoding.UTF8HttpEncodings.ResponseDefaultEncoding returns ISO-8859-1to reflect the new value## 9.0.0section in RELEASE_NOTES.md (this is a breaking change: existing code relying on ISO-8859-1 default may need to setresponseEncodingOverride)The existing
responseEncodingOverrideparameter remains available for callers who need to force a specific encoding, including ISO-8859-1.Test Status