diff --git a/docs/core/compatibility/3.1-5.0.md b/docs/core/compatibility/3.1-5.0.md index d49c96761de06..7a217e1ddf6eb 100644 --- a/docs/core/compatibility/3.1-5.0.md +++ b/docs/core/compatibility/3.1-5.0.md @@ -122,6 +122,7 @@ If you're migrating from version 3.1 of .NET Core, ASP.NET Core, or EF Core to v ## Core .NET libraries +- [[URI paths with non-ASCII characters parse correctly on Unix](#uri-paths-with-non-ascii-characters-parse-correctly-on-unix)] - [Environment.OSVersion returns the correct operating system version](#environmentosversion-returns-the-correct-operating-system-version) - [Complexity of LINQ OrderBy.First{OrDefault} increased](#complexity-of-linq-orderbyfirstordefault-increased) - [IntPtr and UIntPtr implement IFormattable](#intptr-and-uintptr-implement-iformattable) @@ -135,6 +136,10 @@ If you're migrating from version 3.1 of .NET Core, ASP.NET Core, or EF Core to v - [CounterSet.CreateCounterSetInstance now throws InvalidOperationException if instance already exist](#countersetcreatecountersetinstance-now-throws-invalidoperationexception-if-instance-already-exists) - [Microsoft.DotNet.PlatformAbstractions package removed](#microsoftdotnetplatformabstractions-package-removed) +[!INCLUDE [non-ascii-chars-in-uri-parsed-correctly](../../../includes/core-changes/corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md)] + +*** + [!INCLUDE [environment-osversion-returns-correct-version](../../../includes/core-changes/corefx/5.0/environment-osversion-returns-correct-version.md)] *** diff --git a/docs/core/compatibility/corefx.md b/docs/core/compatibility/corefx.md index f71c709666a6e..ba5ca882805e4 100644 --- a/docs/core/compatibility/corefx.md +++ b/docs/core/compatibility/corefx.md @@ -11,6 +11,7 @@ The following breaking changes are documented on this page: | Breaking change | Version introduced | | - | :-: | +| [URI paths with non-ASCII characters parse correctly on Unix](#uri-paths-with-non-ascii-characters-parse-correctly-on-unix) | 5.0 | | [Environment.OSVersion returns the correct operating system version](#environmentosversion-returns-the-correct-operating-system-version) | 5.0 | | [Complexity of LINQ OrderBy.First{OrDefault} increased](#complexity-of-linq-orderbyfirstordefault-increased) | 5.0 | | [IntPtr and UIntPtr implement IFormattable](#intptr-and-uintptr-implement-iformattable) | 5.0 | @@ -42,6 +43,10 @@ The following breaking changes are documented on this page: ## .NET 5.0 +[!INCLUDE [non-ascii-chars-in-uri-parsed-correctly](../../../includes/core-changes/corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md)] + +*** + [!INCLUDE [environment-osversion-returns-correct-version](../../../includes/core-changes/corefx/5.0/environment-osversion-returns-correct-version.md)] *** diff --git a/includes/core-changes/corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md b/includes/core-changes/corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md new file mode 100644 index 0000000000000..bef11c55cb55b --- /dev/null +++ b/includes/core-changes/corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md @@ -0,0 +1,54 @@ +### URI paths with non-ASCII characters parse correctly on Unix + +A bug was fixed in the class such that absolute URI paths that contain non-ASCII characters now parse correctly on Unix platforms. + +#### Change description + +In previous versions of .NET, absolute URI paths that contain non-ASCII characters are parsed incorrectly on Unix platforms, such that segments of the path are duplicated. (Absolute paths are those that start with "/".) The parsing issue has been fixed for .NET 5.0. If you move from a previous version to .NET 5.0 or later, you'll get different values produced by , , and other members. + +Consider the output of the following code when run on Unix on a previous .NET version and on .NET 5.0. + +```csharp +Uri myuri = new Uri("/üri"); + +Console.WriteLine(myuri.AbsoluteUri); +Console.WriteLine(myuri.ToString()); +``` + +Output on previous .NET version: + +```text +AbsoluteUri: /%C3%BCri/%C3%BCri +ToString: /üri/üri +``` + +Output on .NET 5.0 or later version: + +```text +AbsoluteUri: /%C3%BCri +ToString: /üri +``` + +#### Version introduced + +5.0 + +#### Recommended action + +If you have code that expects and accounts for the duplicated path segments, you can remove that code. + +#### Category + +Core .NET libraries + +#### Affected APIs + +- + +