Sample code for 30+ languages & platforms
Rust

URL Encoding and Decoding

Demonstrates URL encoding/decoding using the HTTP convenience methods.

Chilkat Rust Downloads

Rust
let http = chilkat::Http::new();

let s = "Hello World! 100% sure.".to_string();

let encoded = http.url_encode(&s).unwrap_or_default();
println!("URL encoded: {}", encoded);

// Space → %20
// ! → %21
// % → %25

let decoded = http.url_decode(&encoded).unwrap_or_default();
println!("URL decoded: {}", decoded);

// Output:

// URL encoded: Hello%20World%21%20100%25%20sure.
// URL decoded: Hello World! 100% sure.