Question:
I need to create Uri which Contains all its attributes like (OriginalString, Query) as URL encoded.
What I tried:
I am able to format input string of Uri with below options:
string encodedString = inputString.Replace("'", "%27"); //example encoding
OR
System.Net.WebUtility.UrlEncode (inputString)
Tried all approaches to convert string to encoded string, like EscapeDataString/EscapeUriString etc
What I need to achieve
var uri = new Uri(encodedString);
When I create new Uri (like above) again %27
is replaced by '
.
UPDATE 1: Not all fields of uri are converted into %27. OriginalString is converted in my case.
I want to pass this uri to HttpClient.
Do we have any mechanism to make Uri with encoded string.
Based on locale settings and used keyboard, iOS may use some other apostrophe-like character, for example right single quotation mark U+2019 ('). Solution was to handle that.