Bug 56003 - URI returns wrong absolute path on OSX when File name is UTF-8
Summary: URI returns wrong absolute path on OSX when File name is UTF-8
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: master
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Alexis Christoforides
Depends on:
Reported: 2017-05-04 19:14 UTC by Michael DeRoy
Modified: 2017-11-06 23:03 UTC (History)
4 users (show)

See Also:
Tags: bugpool-archive
Is this bug a regression?: ---
Last known good build:

Visual Studio Project REPRO (10.96 KB, application/zip)
2017-05-04 19:14 UTC, Michael DeRoy

Description Michael DeRoy 2017-05-04 19:14:24 UTC
Created attachment 21959 [details]
Visual Studio Project REPRO

To Repro, download the attached Visual Studio for mac project
The English File's excURL will be correct
The Others Will repeat the path once after returning it
Comment 1 Alexis Christoforides 2017-10-12 20:37:25 UTC
Update: The bug involves parsing the "path" section as both path and host. CreateHostString() returns an empty string for the non-UTF8 path.

The URI construction reaches CreateHostString() with these extra flags on the UTF-8 case: HasUnicode, HostUnicodeNormalized, UseOrigUncdStrOffset, PathIriCanonical. The first one is trivially set by CheckForUnicode(), I am looking into how the process is affected the rest.
Comment 2 Alexis Christoforides 2017-10-12 20:54:40 UTC
This seems to be a regression from: https://github.com/mono/mono/commit/b5dc9a4951bd35b61b29faa4df93bca3c31bfa3e

Commenting out the "newHost = null" fixes the issue.  The fix may be to adjust CreateUriInfo instead of removing the host.
Comment 3 Alexis Christoforides 2017-10-19 20:32:15 UTC
Fixed with https://github.com/mono/mono/pull/5778

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Note You need to log in before you can comment on or make changes to this bug.