[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
Conversation
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>
…ault-utf8-rebase-9c637d7c2e08fb9f
Contributor
|
/repo-assist in release notes I bumped major version as this is a breaking change. Fix that version anywhere else needed |
Contributor
Author
|
✓ Repo Assist completed successfully, see workflow run. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Commit pushed:
|
This was referenced Apr 3, 2026
Merged
…ault-utf8-rebase-9c637d7c2e08fb9f
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
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 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.4The 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 test tests/FSharp.Data.Core.Tests/— 2896 passed, 0 failed