Skip to content

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

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/fix-issue-1251-http-response-default-utf8-rebase-2026-04-14-281889ff768f93b1
Draft

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

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

This supersedes PR #1717, which was behind main and had a version conflict. This is a clean rebase of the same fix onto current main (8.1.8 → 8.1.9).

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.9
  • src/AssemblyInfo*.fs — rebuilt to version 8.1.9.0

Test Status

  • dotnet test tests/FSharp.Data.Core.Tests/ --filter HttpEncodings9 passed, 0 failed
  • dotnet test tests/FSharp.Data.Core.Tests/2920 passed, 0 failed
  • ✅ Fantomas format check passed

Generated by Repo Assist

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

To install this agentic workflow, run

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

github-actions bot and others added 2 commits April 14, 2026 04:52
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>
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