diff --git a/docs/core/compatibility/3.1-5.0.md b/docs/core/compatibility/3.1-5.0.md index ae38163e388f9..ec6923ef72d8b 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) - [Uri recognition of UNC paths on Unix](#uri-recognition-of-unc-paths-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) @@ -136,6 +137,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 [unc-path-recognition-unix](../../../includes/core-changes/corefx/5.0/unc-path-recognition-unix.md)] *** diff --git a/docs/core/compatibility/corefx.md b/docs/core/compatibility/corefx.md index 67254c90f7dde..f7d983baedde2 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 | | [Uri recognition of UNC paths on Unix](#uri-recognition-of-unc-paths-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 | @@ -43,6 +44,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 [unc-path-recognition-unix](../../../includes/core-changes/corefx/5.0/unc-path-recognition-unix.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..1857a13bed20a --- /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, and 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 of .NET 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. + +```csharp +var myUri = new Uri("/üri"); + +Console.WriteLine($"AbsoluteUri: {myUri.AbsoluteUri}"); +Console.WriteLine($"ToString: {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 + +- + +