Function url::encode
pub fn encode(s: &str) -> ~str
Encodes a URI by replacing reserved characters with percent-encoded character sequences.
This function is compliant with RFC 3986.
Example
use url::encode; let url = encode(&"https://example.com/Rust (programming language)"); println!("{}", url); // https://example.com/Rust%20(programming%20language)