What would be the right way to create a fully URL-encoded URI file://from a local path, i.e. where all special characters are hidden, such as spaces, etc.
Given the following input
C:\Data\Input Document.txt
I would like to receive
file:///C:/Data/Input%20Document.txt
I used
Uri uri = new Uri(@"C:\Data\Input Document.txt", UriKind.RelativeOrAbsolute);
However, this leads to an unshielded URI:
file:
source
share