Skip to content

System.Uri constructor returns an object that does is not equal to the input #56482

Closed

Description

@edoust

Description

Create a Uri that represents a MAPI item

Example code:

var input = "mapi16:///{S-1-5-0000000}/[email protected]/곯가가가공갫갡곤갘갖갯걆겹갹곓곌갂겥강걥겤걿갨가";
var uri = new Uri(input, UriKind.Absolute);

Expected:
uri should have the same value as input

Actual:
uri has this value: mapi16:///{S-1-5-0000000}/[email protected]/곯가가가공갫갡곤갘갖갯걆겹갹곓곌갂겥강걥겤걿갨가/{S-1-5-0000000}/[email protected]/곯가가가공갫갡곤갘갖갯걆겹갹곓곌갂겥강걥겤걿갨가

Configuration

Code is running on .NET 5

Regression?

This was working in both .NET Framework and UWP (.NET Core)

Activity

  1. ghost added
    untriaged
    on Jul 28, 2021
  2. MihaZupan commented on Jul 29, 2021

    @MihaZupan
    Member

    Doesn't repro on net48, reproes on netcoreapp2.1 and newer. Looks like a Framework => Core regression.

    Simplified repro

    Console.WriteLine(new Uri("custom:///ü").AbsoluteUri);
    // custom:///%C3%BC/%C3%BC

    Note that the host starts with / (triple slash).

    This looks like another manifestation of #1061 that was fixed by #36429 for 5.0.
    Seems to affect file-like Uri schemes (custom ones, mailto, vsmacros).

  3. added this to the 7.0.0 milestone on Jul 29, 2021
  4. removed
    untriaged
    on Jul 29, 2021
  5. karelz commented on Jul 29, 2021

    @karelz
    Member

    Triage: We should fix it. Not a regression against 5.0 -> moving to 7.0.

  6. added
    tenet-compatibility
    on Jul 29, 2021
  7. ghost added
    in-pr
    on Sep 21, 2021
  8. ghost removed
    in-pr
    on Sep 21, 2021
  9. ghost locked as resolved and limited conversation to collaborators on Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Netbugtenet-compatibility

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions