Wednesday, September 6, 2017

UriEncode

There are two static methods in System.Uri: EscapeDataString and EscapeUriString. Use first to escape any string after '?' in uri and second one to escape any string before '?':

Symbol EscapeUriString EscapeDataString
aaa
bbb
ccc
space%20%20
??%3F
!!%21
@@%40
##%23
$$%24
%%25%25
^%5E%5E
&&%26
**%2A
((%28
))%29
//%2F
\%5C%5C
++%2B
___
---
<%3C%3C
>%3E%3E
,,%2C
...
''%27
"%22%22
`%60%60
~~~
а%D0%B0%D0%B0
б%D0%B1%D0%B1
в%D0%B2%D0%B2