[Repo Assist] fix: change HTTP response default encoding from ISO-8859-1 to UTF-8 (Closes #1251)#1754
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
…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>
This was referenced Apr 22, 2026
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.
Closes #1251
Supersedes #1717 (that PR's branch accumulated merge commits from
mainincluding protected workflow files, making pushes to it fail; this is a clean rebase onto currentmain).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."Changes
src/FSharp.Data.Http/Http.fs—ResponseDefaultEncodingchanged fromEncoding.GetEncoding("ISO-8859-1")toEncoding.UTF8; doc comment updatedsrc/FSharp.Data.DesignTime/{Csv,Json,Xml,Html}Provider.fs—EncodingXML doc param updated to reflect new defaulttests/FSharp.Data.Core.Tests/HttpEncodings.fs— updated test to expectutf-8RELEASE_NOTES.md— version bump to 8.1.11The existing
responseEncodingOverrideparameter 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 updatedResponseDefaultEncoding returns UTF-8test)dotnet run --project build/build.fsproj -t RunTests— 2957 core tests + 489 design-time tests, 0 failed