## URI returns wrong absolute path on OSX when File name is UTF-8

_Submitted by a community member on 2017-05-04 19:14 UTC_

To Repro, download the attached Visual Studio for mac project
The English File's excURL will be correct
"file:///Users/Text.txt"
The Others Will repeat the path once after returning it
"file:///Users/%D0%A2%D0%B5%D0%BA%D1%81%D1%82.txt/Users/%D0%A2%D0%B5%D0%BA%D1%81%D1%82.txt"

* * *

_Xamarin Bugzilla comment 1 by Alexis Christoforides [MSFT] on 2017-10-12 20:37 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.

* * *

_Xamarin Bugzilla comment 2 by Alexis Christoforides [MSFT] on 2017-10-12 20:54 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.

* * *

_Xamarin Bugzilla comment 3 by Alexis Christoforides [MSFT] on 2017-10-19 20:32 UTC_

Fixed with <https://github.com/mono/mono/pull/5778>

* * *

<br />

_Reference: <https://bugzilla.xamarin.com/show_bug.cgi?id=56003>_