forked from dotnet/docs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
includes/core-changes/corefx/5.0/non-ascii-chars-in-uri-parsed-correctly.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` | ||
--> |