Skip to content

[Repo Assist] Change HTTP response default encoding from ISO-8859-1 to UTF-8#1665

Draft
github-actions[bot] wants to merge 5 commits intomainfrom
repo-assist/fix-issue-1251-http-response-default-utf8-ba30ad37ff9bf8f6
Draft

[Repo Assist] Change HTTP response default encoding from ISO-8859-1 to UTF-8#1665
github-actions[bot] wants to merge 5 commits intomainfrom
repo-assist/fix-issue-1251-http-response-default-utf8-ba30ad37ff9bf8f6

Conversation

@github-actions
Copy link
Contributor

🤖 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.HttpClient behaviour.

Closes #1251

Root Cause

HttpEncodings.ResponseDefaultEncoding was set to ISO-8859-1, following RFC 2616 §3.7.1. However, modern HTTP servers, browsers, and System.Net.Http.HttpClient all default to UTF-8 in practice when no charset is specified in the Content-Type response header. This caused garbled characters when fetching UTF-8 content from servers that don't include an explicit charset.

@dsyme endorsed this fix in a comment: "Agreed we should do the same as HttpClient and do this."

Change

  • HttpEncodings.ResponseDefaultEncoding changed from Encoding.GetEncoding("ISO-8859-1") to Encoding.UTF8
  • Updated XML doc comments across the type providers (XmlProvider, JsonProvider, CsvProvider, HtmlProvider) to reflect the new default
  • Updated the test HttpEncodings.ResponseDefaultEncoding returns ISO-8859-1 to reflect the new value

The existing responseEncodingOverride parameter remains available for callers who need to force a specific encoding, including ISO-8859-1.

Test Status

  • ✅ Build: succeeded (19 pre-existing warnings, 0 errors)
  • HttpEncodings tests: all 9 pass
  • ✅ Core tests: 2846 passed, 1 skipped (network test Two custom headers... — sandbox firewall blocks outbound HTTP, infrastructure issue unrelated to this change)

Generated by Repo Assist

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@69c1ee19e39e6aaba35519aafefb5cbf314de323

Warning

⚠️ Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • www.google.com

Matches System.Net.Http.HttpClient behaviour. RFC 2616 specifies
ISO-8859-1 as the default, but modern servers, browsers, and HttpClient
all default to UTF-8 in practice. This fixes garbled characters when
fetching UTF-8 content from servers that don't specify a charset.

The responseEncodingOverride parameter can still be used to override
for any response, including forcing ISO-8859-1 when needed.

Closes #1251

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme
Copy link
Contributor

dsyme commented Feb 26, 2026

/repo-assist Please major bump the version to 9.0.0 as this could be considered a breaking change

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Contributor Author

Commit pushed: caf212b

Generated by Repo Assist

@github-actions
Copy link
Contributor Author

🤖 Repo Assist here. Done! I've bumped the version from 8.1.0-beta to 9.0.0 - Feb 26 2026 in RELEASE_NOTES.md and pushed the change to this PR branch. The change in HTTP default encoding from ISO-8859-1 to UTF-8 is indeed a behavioural breaking change, so a major version bump is appropriate.

Generated by Repo Assist for issue #1665

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@afb00b92a9514fee9a14c583f059a03d05738f70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with Http.RequestString detection of response content encoding

1 participant