Skip to content

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

Open
github-actions[bot] wants to merge 6 commits intomainfrom
repo-assist/fix-issue-1251-http-response-default-utf8-rebase-9c637d7c2e08fb9f
Open

[Repo Assist] fix: change HTTP response default encoding from ISO-8859-1 to UTF-8 (Closes #1251)#1717
github-actions[bot] wants to merge 6 commits intomainfrom
repo-assist/fix-issue-1251-http-response-default-utf8-rebase-9c637d7c2e08fb9f

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 1, 2026

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

Closes #1251

This supersedes PR #1665, which had an unresolvable merge conflict after several subsequent changes were merged to main. This is a clean rebase of the same fix onto current main.

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."

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.4

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 HttpEncodings — 9 passed (including the updated ResponseDefaultEncoding returns UTF-8 test)
  • dotnet test tests/FSharp.Data.Core.Tests/2896 passed, 0 failed

Generated by Repo Assist

Generated by 🌈 Repo Assist at {run-started}. Learn more.

To install this agentic workflow, run

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

Closes #1251

Changes HttpEncodings.ResponseDefaultEncoding from ISO-8859-1 to UTF-8 to
match System.Net.Http.HttpClient behaviour. Modern servers and browsers
default to UTF-8 when no charset is specified in Content-Type; RFC 2616's
ISO-8859-1 default causes garbled text when consuming real-world APIs.

- Update HttpEncodings.ResponseDefaultEncoding to Encoding.UTF8
- Update XML doc comments in all four type provider source files
- Update HttpEncodings test to expect utf-8
- Bump version to 8.1.4 in RELEASE_NOTES.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme closed this Apr 1, 2026
@dsyme dsyme reopened this Apr 1, 2026
@dsyme dsyme marked this pull request as ready for review April 1, 2026 16:23
@dsyme
Copy link
Copy Markdown
Contributor

dsyme commented Apr 3, 2026

/repo-assist in release notes I bumped major version as this is a breaking change. Fix that version anywhere else needed

@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions bot commented Apr 3, 2026

✓ Repo Assist completed successfully, see workflow run.

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

github-actions bot commented Apr 3, 2026

Commit pushed: 0a5606b

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

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