How to URL encode strings in C#
问题 How can we encode a string using the URL (RFC 1738) standard in C#? The following online tool is converting the strings using this standard http://www.freeformatter.com/url-encoder.html An example of the string I want to convert is test(brackets) and the encoded string should look like: test%28brackets%29 回答1: According to RFC 1738: Thus, only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.