Encodes a string using percent-encoding, specifying which characters should be encoded (optionally including reserved characters).
Namespace: Facilita.WebAssembly: clrWebBrowser (in clrWebBrowser.dll) Version: 9.5.8.37 (1.0.0.0)
Syntax
Parameters
- urlFragment
- Type: System String
The text to percent-encode.
- unsafeCharacters
- Type: System String
A string containing a list of characters that need to be percent-encoded.
- encodeReservedCharacters
- Type: System Boolean
true if reserved characters should be encoded.
Return Value
The encoded text.Remarks
- It is outside the printable ASCII range (i.e. is not in the ASCII range 32 to 127) OR
- It is one of the defined unsafeCharacters OR
- It is a reserved character, and encodeReservedCharacters has the value true
For more information about percent-encoding, refer to RFC 3986.
Examples
string encoded = Coder.UrlEncode("search?q=camera", "<>\"%{}|\\^[]` \n\t\r&", true); // encoded == search%3Fq%3Dcamera
See Also