Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorAlexis Christoforides <alexis@thenull.net>2017-10-19 19:46:13 +0300
committerGitHub <noreply@github.com>2017-10-19 19:46:13 +0300
commit1538798867f689b9c0064feff4067d78b518c3e9 (patch)
tree40cf02012631417cc5051904987a5b8759f20cd3 /mcs
parent61559965a188d03456d6f7840a0cdabdf35c2400 (diff)
parent0ccfa87a91e1ff571527973405991a8213c3cf86 (diff)
Merge pull request #5778 from alexischr/bug-56003
[System.URI] Don't reset host string processing on Unicode paths. Fix…
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System/Test/System/UriTest.cs11
-rw-r--r--mcs/class/referencesource/System/net/System/URI.cs7
2 files changed, 11 insertions, 7 deletions
diff --git a/mcs/class/System/Test/System/UriTest.cs b/mcs/class/System/Test/System/UriTest.cs
index b6bc2b8f15b..2db2fb21283 100644
--- a/mcs/class/System/Test/System/UriTest.cs
+++ b/mcs/class/System/Test/System/UriTest.cs
@@ -2071,5 +2071,16 @@ namespace MonoTests.System
var uri = new Uri ("https://_foo/bar.html");
Assert.AreEqual ("https", uri.Scheme);
}
+
+ [Test]
+ public void ImplicitUnixFileWithUnicodeGetAbsoluleUri ()
+ {
+ if (isWin32)
+ Assert.Ignore ();
+
+ string escFilePath = "/Users/Текст.txt";
+ string escUrl = new Uri (escFilePath, UriKind.Absolute).AbsoluteUri;
+ Assert.AreEqual ("file:///Users/%D0%A2%D0%B5%D0%BA%D1%81%D1%82.txt", escUrl);
+ }
}
}
diff --git a/mcs/class/referencesource/System/net/System/URI.cs b/mcs/class/referencesource/System/net/System/URI.cs
index 73e505d344e..24ddbc66e15 100644
--- a/mcs/class/referencesource/System/net/System/URI.cs
+++ b/mcs/class/referencesource/System/net/System/URI.cs
@@ -3969,13 +3969,6 @@ namespace System {
if (hasUnicode && iriParsing && hostNotUnicodeNormalized){
flags |= Flags.HostUnicodeNormalized;// no host
-#if MONO
- // I am not certain this is the best fix but for Unix implicit paths with
- // unicode characters the host must be valid (null or non-empty) as
- // CreateUriInfo assumes. This should happen only for paths like /foo/path-with-unicode
- if (newHost.Length == 0 && (flags & Flags.BasicHostType) != 0)
- newHost = null;
-#endif
}
return idx;