diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/rust/urlencoding/README.md | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/urlencoding/README.md')
-rw-r--r-- | third_party/rust/urlencoding/README.md | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/third_party/rust/urlencoding/README.md b/third_party/rust/urlencoding/README.md new file mode 100644 index 0000000000..5088cf1298 --- /dev/null +++ b/third_party/rust/urlencoding/README.md @@ -0,0 +1,50 @@ +# urlencoding + +[![Latest Version](https://img.shields.io/crates/v/urlencoding.svg)](https://crates.io/crates/urlencoding) + +A Rust library for doing URL percentage encoding. + +Installation +============ + +This crate can be downloaded through Cargo. To do so, add the following line to your `Cargo.toml` file, under `dependencies`: + +```toml +urlencoding = "1.0.0" +``` + +Usage +===== + +To encode a string, do the following: + +```rust +extern crate urlencoding; + +use urlencoding::encode; + +fn main() { + let encoded = encode("This string will be URL encoded."); + println!("{}", encoded); + // This%20string%20will%20be%20URL%20encoded. +} +``` + +To decode a string, it's only slightly different: + +```rust +extern crate urlencoding; + +use urlencoding::decode; + +fn main() { + let decoded = decode("%F0%9F%91%BE%20Exterminate%21"); + println!("{}", decoded.unwrap()); + // 👾 Exterminate! +} +``` + +License +======= + +This project is licensed under the MIT license, Copyright (c) 2017 Bertram Truong. For more information see the `LICENSE` file. |