Skip to content

[Repo Assist] fix: change HTTP response default encoding from ISO-8859-1 to UTF-8 (Closes #1251)#1758

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-1251-http-utf8-rebase-2026-04-24-f0722af906b58b7c
Draft

[Repo Assist] fix: change HTTP response default encoding from ISO-8859-1 to UTF-8 (Closes #1251)#1758
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-1251-http-utf8-rebase-2026-04-24-f0722af906b58b7c

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.

Closes #1251
Supersedes #1754 (that PR had a merge conflict in RELEASE_NOTES.md after #1756 was merged and bumped to 8.1.11; this is a clean rebase onto current main with version bumped to 8.1.12).
Also supersedes #1717.

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: "Agreed we should do the same as HttpClient and do this."

Note on versioning: This is a behaviour change for callers that relied on ISO-8859-1 as the default. If you consider this a breaking change, the version bump can be changed from 8.1.12 to 9.0.0.

Changes

  • src/FSharp.Data.Http/Http.fsResponseDefaultEncoding changed from Encoding.GetEncoding("ISO-8859-1") to Encoding.UTF8; doc comment updated
  • src/FSharp.Data.DesignTime/{Csv,Json,Xml,Html}Provider.fsEncoding XML doc param updated to reflect new default
  • tests/FSharp.Data.Core.Tests/HttpEncodings.fs — updated test to expect utf-8
  • RELEASE_NOTES.md — version bump to 8.1.12
  • src/AssemblyInfo*.fs — version bumped to 8.1.12

The existing responseEncodingOverride parameter remains available for callers who need to force ISO-8859-1.

Test Status

  • dotnet test tests/FSharp.Data.Core.Tests/ --filter HttpEncodings9 passed (including the updated ResponseDefaultEncoding returns UTF-8 test)

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

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

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

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

github-actions Bot and others added 2 commits April 24, 2026 04:50
…loses #1251)

ResponseDefaultEncoding now defaults to UTF-8, matching System.Net.Http.HttpClient
behaviour. RFC 2616 specified ISO-8859-1 but modern servers and browsers default to
UTF-8; the old default caused garbled output when fetching UTF-8 content without an
explicit charset in the Content-Type response header.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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

0 participants