Skip to content

Commit

Permalink
Fixes dotnet#19965
Browse files Browse the repository at this point in the history
  • Loading branch information
gewarren committed Aug 17, 2020
1 parent c9a44a1 commit 3c6366a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/core/compatibility/3.1-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)]

***
Expand Down
5 changes: 5 additions & 0 deletions docs/core/compatibility/corefx.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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)]

***
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
### URI paths with non-ASCII characters parse correctly on Unix

A bug was fixed in the <xref:System.Uri?displayProperty=fullName> 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 <xref:System.Uri.AbsoluteUri?displayProperty=nameWithType>, <xref:System.Uri.ToString?displayProperty=nameWithType>, 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

- <xref:System.Uri?displayProperty=fullName>

<!--
#### Affected APIs
- `T:System.Uri`
-->

0 comments on commit 3c6366a

Please sign in to comment.