README.md
1# urlencoding
2
3[![Latest Version](https://img.shields.io/crates/v/urlencoding.svg)](https://crates.io/crates/urlencoding)
4
5A Rust library for doing URL percentage encoding.
6
7Installation
8============
9
10This crate can be downloaded through Cargo. To do so, add the following line to your `Cargo.toml` file, under `dependencies`:
11
12```toml
13urlencoding = "1.0.0"
14```
15
16Usage
17=====
18
19To encode a string, do the following:
20
21```rust
22extern crate urlencoding;
23
24use urlencoding::encode;
25
26fn main() {
27 let encoded = encode("This string will be URL encoded.");
28 println!("{}", encoded);
29 // This%20string%20will%20be%20URL%20encoded.
30}
31```
32
33To decode a string, it's only slightly different:
34
35```rust
36extern crate urlencoding;
37
38use urlencoding::decode;
39
40fn main() {
41 let decoded = decode("%F0%9F%91%BE%20Exterminate%21");
42 println!("{}", decoded.unwrap());
43 // Exterminate!
44}
45```
46
47License
48=======
49
50This project is licensed under the MIT license, Copyright (c) 2017 Bertram Truong. For more information see the `LICENSE` file.
51