From 3c6366a9e9e20b1678e716c0e44d8e9860633185 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 17 Aug 2020 15:20:49 -0700 Subject: [PATCH 1/4] Fixes #19965 --- docs/core/compatibility/3.1-5.0.md | 5 ++ docs/core/compatibility/corefx.md | 5 ++ ...non-ascii-chars-in-uri-parsed-correctly.md | 54 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 includes/core-changes/corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md 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 + +- + + From 475935931b168bba2b39065ffbf5afd0244107c0 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 17 Aug 2020 15:35:42 -0700 Subject: [PATCH 2/4] review on staging --- docs/core/compatibility/3.1-5.0.md | 2 +- .../corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/core/compatibility/3.1-5.0.md b/docs/core/compatibility/3.1-5.0.md index 7a217e1ddf6eb..e2b13a53a2ba5 100644 --- a/docs/core/compatibility/3.1-5.0.md +++ b/docs/core/compatibility/3.1-5.0.md @@ -122,7 +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 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) 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 index bef11c55cb55b..af4a709a75bc5 100644 --- 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 @@ -4,9 +4,9 @@ A bug was fixed in the class such tha #### 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. +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 on a previous .NET version and on .NET 5.0. +Consider the output of the following code when run on Unix. ```csharp Uri myuri = new Uri("/üri"); From 83bb3e8a307f604c6ca80c89f941a25c6c86983a Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 20 Aug 2020 09:41:27 -0700 Subject: [PATCH 3/4] Update includes/core-changes/corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md Co-authored-by: Youssef Victor <31348972+Youssef1313@users.noreply.github.com> --- .../corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index af4a709a75bc5..cf2262baa8e42 100644 --- 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 @@ -9,7 +9,7 @@ In previous versions of .NET, absolute URI paths that contain non-ASCII characte Consider the output of the following code when run on Unix. ```csharp -Uri myuri = new Uri("/üri"); +var myUri = new Uri("/üri"); Console.WriteLine(myuri.AbsoluteUri); Console.WriteLine(myuri.ToString()); From 018f2f945f507a8aeefe8cb2b535a9cb2689b1b6 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 20 Aug 2020 09:55:47 -0700 Subject: [PATCH 4/4] Fix snippet --- .../corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index cf2262baa8e42..1857a13bed20a 100644 --- 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 @@ -11,8 +11,8 @@ Consider the output of the following code when run on Unix. ```csharp var myUri = new Uri("/üri"); -Console.WriteLine(myuri.AbsoluteUri); -Console.WriteLine(myuri.ToString()); +Console.WriteLine($"AbsoluteUri: {myUri.AbsoluteUri}"); +Console.WriteLine($"ToString: {myUri.ToString()}"); ``` Output on previous .NET version: