-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Description
In the AbsoluteUriConverter
class, we use Uri.ToString()
.
csharp-language-server-protocol/src/Protocol/Serialization/Converters/AbsoluteUriConverter.cs
Line 54 in 2b06e03
writer.WriteValue(uriValue.ToString()); |
Unfortunately, the Uri.ToString()
has bizarre behavior with Uris with escaped non-ASCII characters.
> new Uri("/Users/tyleonha/Code/PowerShell/Misc/测试.ps1").ToString()
file:///Users/tyleonha/Code/PowerShell/Misc/%E6%B5%8B%E8%AF%95.ps1/Users/tyleonha/Code/PowerShell/Misc/测试.ps1
Notice the path is written twice?
This only seems to happen on non-Windows as adding a drive letter fixes it... but then it url decodes the characters:
> new Uri("file:///C:/Users/tyleonha/Code/PowerShell/Misc/%E6%B5%8B%E8%AF%95.ps1").ToString()
file:///C:/Users/tyleonha/Code/PowerShell/Misc/测试.ps1
But then again... since VS Code expects the colon to be escaped in the drive letter... we're still left in a bad state:
new Uri("file:///C%3A/Users/tyleonha/Code/PowerShell/Misc/%E6%B5%8B%E8%AF%95.ps1").ToString()
file://%2FC%3A%2FUsers%2Ftyleonha%2FCode%2FPowerShell%2FMisc%2F测试.ps1/C%3A/Users/tyleonha/Code/PowerShell/Misc/测试.ps1
Metadata
Metadata
Assignees
Labels
No labels