From d2643621d47f9f7773f4090a7dec26e182137c50 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 26 Feb 2026 11:54:47 +0000 Subject: [PATCH 1/6] Change HTTP response default encoding from ISO-8859-1 to UTF-8 Matches System.Net.Http.HttpClient behaviour. RFC 2616 specifies ISO-8859-1 as the default, but modern servers, browsers, and HttpClient all default to UTF-8 in practice. This fixes garbled characters when fetching UTF-8 content from servers that don't specify a charset. The responseEncodingOverride parameter can still be used to override for any response, including forcing ISO-8859-1 when needed. Closes #1251 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- RELEASE_NOTES.md | 1 + src/FSharp.Data.DesignTime/Csv/CsvProvider.fs | 2 +- src/FSharp.Data.DesignTime/Html/HtmlProvider.fs | 2 +- src/FSharp.Data.DesignTime/Json/JsonProvider.fs | 2 +- src/FSharp.Data.DesignTime/Xml/XmlProvider.fs | 2 +- src/FSharp.Data.Http/Http.fs | 4 ++-- tests/FSharp.Data.Core.Tests/HttpEncodings.fs | 4 ++-- 7 files changed, 9 insertions(+), 8 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b69a921b9..f651b2a5c 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -2,6 +2,7 @@ ## 8.1.0-beta +- Change HTTP response default encoding from ISO-8859-1 to UTF-8 to match `System.Net.Http.HttpClient` behaviour (closes #1251) - Add `PreferOptionals` parameter to `JsonProvider` and `XmlProvider` (defaults to `true` to match existing behavior; set to `false` to use empty string or `NaN` for missing values, like the CsvProvider default) (closes #649) ## 8.0.0 - Feb 25 2026 diff --git a/src/FSharp.Data.DesignTime/Csv/CsvProvider.fs b/src/FSharp.Data.DesignTime/Csv/CsvProvider.fs index 05c59fa9b..dc1644559 100644 --- a/src/FSharp.Data.DesignTime/Csv/CsvProvider.fs +++ b/src/FSharp.Data.DesignTime/Csv/CsvProvider.fs @@ -264,7 +264,7 @@ type public CsvProvider(cfg: TypeProviderConfig) as this = + """. Whether the rows should be caches so they can be iterated multiple times. Defaults to true. Disable for large datasets. The culture used for parsing numbers and dates. Defaults to the invariant culture. - The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and to ISO-8859-1 the for HTTP requests, unless charset is specified in the Content-Type response header. + The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and for HTTP requests when no charset is specified in the Content-Type response header. A directory that is used when resolving relative file references (at design time and in hosted execution). When specified, the type provider first attempts to load the sample from the specified resource (e.g. 'MyCompany.MyAssembly, resource_name.csv'). This is useful when exposing types generated by the type provider. diff --git a/src/FSharp.Data.DesignTime/Html/HtmlProvider.fs b/src/FSharp.Data.DesignTime/Html/HtmlProvider.fs index bedb1a34b..4c59362d8 100644 --- a/src/FSharp.Data.DesignTime/Html/HtmlProvider.fs +++ b/src/FSharp.Data.DesignTime/Html/HtmlProvider.fs @@ -111,7 +111,7 @@ type public HtmlProvider(cfg: TypeProviderConfig) as this = + String.Join(",", TextConversions.DefaultMissingValues) + """. The culture used for parsing numbers and dates. Defaults to the invariant culture. - The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and to ISO-8859-1 the for HTTP requests, unless charset is specified in the Content-Type response header. + The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and for HTTP requests when no charset is specified in the Content-Type response header. A directory that is used when resolving relative file references (at design time and in hosted execution). When specified, the type provider first attempts to load the sample from the specified resource (e.g. 'MyCompany.MyAssembly, resource_name.html'). This is useful when exposing types generated by the type provider. diff --git a/src/FSharp.Data.DesignTime/Json/JsonProvider.fs b/src/FSharp.Data.DesignTime/Json/JsonProvider.fs index fbd2688a0..3af7606ae 100644 --- a/src/FSharp.Data.DesignTime/Json/JsonProvider.fs +++ b/src/FSharp.Data.DesignTime/Json/JsonProvider.fs @@ -186,7 +186,7 @@ type public JsonProvider(cfg: TypeProviderConfig) as this = If true, sample should be a list of individual samples for the inference. The name to be used to the root type. Defaults to `Root`. The culture used for parsing numbers and dates. Defaults to the invariant culture. - The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and to ISO-8859-1 the for HTTP requests, unless `charset` is specified in the `Content-Type` response header. + The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and for HTTP requests when no `charset` is specified in the `Content-Type` response header. A directory that is used when resolving relative file references (at design time and in hosted execution). When specified, the type provider first attempts to load the sample from the specified resource (e.g. 'MyCompany.MyAssembly, resource_name.json'). This is useful when exposing types generated by the type provider. diff --git a/src/FSharp.Data.DesignTime/Xml/XmlProvider.fs b/src/FSharp.Data.DesignTime/Xml/XmlProvider.fs index bb7b9cdbf..8a8e29ba4 100644 --- a/src/FSharp.Data.DesignTime/Xml/XmlProvider.fs +++ b/src/FSharp.Data.DesignTime/Xml/XmlProvider.fs @@ -213,7 +213,7 @@ type public XmlProvider(cfg: TypeProviderConfig) as this = If true, the children of the root in the sample document represent individual samples for the inference. If true, the inference unifies all XML elements with the same name. The culture used for parsing numbers and dates. Defaults to the invariant culture. - The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and to ISO-8859-1 the for HTTP requests, unless charset is specified in the Content-Type response header. + The encoding used to read the sample. You can specify either the character set name or the codepage number. Defaults to UTF8 for files, and for HTTP requests when no charset is specified in the Content-Type response header. A directory that is used when resolving relative file references (at design time and in hosted execution). When specified, the type provider first attempts to load the sample from the specified resource (e.g. 'MyCompany.MyAssembly, resource_name.xml'). This is useful when exposing types generated by the type provider. diff --git a/src/FSharp.Data.Http/Http.fs b/src/FSharp.Data.Http/Http.fs index e394ad507..83cbd9847 100644 --- a/src/FSharp.Data.Http/Http.fs +++ b/src/FSharp.Data.Http/Http.fs @@ -1376,8 +1376,8 @@ module HttpEncodings = /// ISO-8859-1 let PostDefaultEncoding = Encoding.GetEncoding("ISO-8859-1") // http://stackoverflow.com/questions/708915/detecting-the-character-encoding-of-an-http-post-request/708942#708942 - /// ISO-8859-1 - let ResponseDefaultEncoding = Encoding.GetEncoding("ISO-8859-1") // http://www.ietf.org/rfc/rfc2616.txt + /// UTF-8 (matches System.Net.Http.HttpClient default behaviour; RFC 2616 specifies ISO-8859-1 but modern servers and browsers default to UTF-8) + let ResponseDefaultEncoding = Encoding.UTF8 let internal getEncoding (encodingStr: string) = match Int32.TryParse(encodingStr, NumberStyles.Integer, CultureInfo.InvariantCulture) with diff --git a/tests/FSharp.Data.Core.Tests/HttpEncodings.fs b/tests/FSharp.Data.Core.Tests/HttpEncodings.fs index 5aaba8721..b2a3ee869 100644 --- a/tests/FSharp.Data.Core.Tests/HttpEncodings.fs +++ b/tests/FSharp.Data.Core.Tests/HttpEncodings.fs @@ -10,8 +10,8 @@ let ``HttpEncodings.PostDefaultEncoding returns ISO-8859-1`` () = HttpEncodings.PostDefaultEncoding.WebName |> should equal "iso-8859-1" [] -let ``HttpEncodings.ResponseDefaultEncoding returns ISO-8859-1`` () = - HttpEncodings.ResponseDefaultEncoding.WebName |> should equal "iso-8859-1" +let ``HttpEncodings.ResponseDefaultEncoding returns UTF-8`` () = + HttpEncodings.ResponseDefaultEncoding.WebName |> should equal "utf-8" [] let ``HttpEncodings.getEncoding with valid encoding name works`` () = From 1bd1e62f86b072c479718c4d841a7d1a1c7830c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 26 Feb 2026 11:58:03 +0000 Subject: [PATCH 2/6] ci: trigger CI checks From caf212b2f4c86c811a60622c36afc1a370d40f21 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 26 Feb 2026 14:02:11 +0000 Subject: [PATCH 3/6] Bump version to 9.0.0 (breaking change - HTTP encoding default change) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index f651b2a5c..1ff210d80 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,6 @@ # Release Notes -## 8.1.0-beta +## 9.0.0 - Feb 26 2026 - Change HTTP response default encoding from ISO-8859-1 to UTF-8 to match `System.Net.Http.HttpClient` behaviour (closes #1251) - Add `PreferOptionals` parameter to `JsonProvider` and `XmlProvider` (defaults to `true` to match existing behavior; set to `false` to use empty string or `NaN` for missing values, like the CsvProvider default) (closes #649) From dbaa6cf7fd1dacf4cfbde92c002b3f12ab6763a1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 26 Feb 2026 14:04:46 +0000 Subject: [PATCH 4/6] ci: trigger CI checks From 3782d0f2f3d91cf23fcb053690ff490baa5111f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Mar 2026 03:43:49 +0000 Subject: [PATCH 5/6] Update RELEASE_NOTES.md: add missing 9.0.0 items (ExceptionIfMissing, trimming) and fix heading Syncs the 9.0.0 section with all items from main's 8.1.0-beta: - ExceptionIfMissing (merged separately) - Trimming support (merged separately) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- RELEASE_NOTES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 37b6aca40..8f9f92bbe 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,13 +1,15 @@ # Release Notes -## 9.0.0 - Feb 26 2026 +## 9.0.0 - Change HTTP response default encoding from ISO-8859-1 to UTF-8 to match `System.Net.Http.HttpClient` behaviour (closes #1251) +- Add `ExceptionIfMissing` static parameter to `JsonProvider` and `XmlProvider`: when true, accessing a non-optional field that is missing in the data raises an exception instead of silently returning a default value (empty string for string, NaN for float). Defaults to false for backward compatibility. - Add `Http.ParseLinkHeader` utility for parsing RFC 5988 `Link` response headers (used by GitHub, GitLab, and other paginated APIs) into a `Map` from relation name to URL (closes #805) - Add `PreferDateTimeOffset` parameter to `CsvProvider`, `JsonProvider`, and `XmlProvider`: when true, date-time values without an explicit timezone offset are inferred as `DateTimeOffset` (using local offset) instead of `DateTime` (closes #1100, #1072) - Make `Http.AppendQueryToUrl` public (closes #1325) - Add `PreferOptionals` parameter to `JsonProvider` and `XmlProvider` (defaults to `true` to match existing behavior; set to `false` to use empty string or `NaN` for missing values, like the CsvProvider default) (closes #649) - Add `UseSchemaTypeNames` parameter to `XmlProvider`: when `true` and `Schema` is provided, multiple elements sharing the same XSD complex type generate a single F# type (named after the XSD type) instead of separate per-element types (closes #1488) +- Mark all runtime Core libraries as trimmable (`IsTrimmable=true`); replace reflection-based stack-trace preservation in `Http.fs` with `ExceptionDispatchInfo`, and remove dead Mono-detection code (closes #1436) ## 8.0.0 - Feb 25 2026 From fcfe2b421644a32325ee34a6c89e36b496be3c53 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 5 Mar 2026 03:47:16 +0000 Subject: [PATCH 6/6] ci: trigger checks