chore: Use percent-encoding 2.1.0

This commit is contained in:
Mike Welsh 2020-01-13 11:07:30 -08:00
parent 52607d4706
commit 79745feef7
3 changed files with 4 additions and 2 deletions

1
Cargo.lock generated
View File

@ -1637,6 +1637,7 @@ dependencies = [
"jpeg-decoder 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
"js-sys 0.3.34 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ruffle_core 0.1.0",
"svg 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -21,6 +21,7 @@ js-sys = "0.3.25"
log = "0.4"
png = "0.15.3"
svg = "0.6.0"
percent-encoding = "2.1.0"
url = "2.1.1"
wasm-bindgen = "0.2.57"

View File

@ -304,12 +304,12 @@ impl RenderBackend for WebCanvasRenderBackend {
);
}
use url::percent_encoding::{utf8_percent_encode, DEFAULT_ENCODE_SET};
use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC};
let svg = swf_shape_to_svg(&shape, &bitmaps, self.pixelated_property_value);
let svg_encoded = format!(
"data:image/svg+xml,{}",
utf8_percent_encode(&svg, DEFAULT_ENCODE_SET) //&base64::encode(&svg[..])
utf8_percent_encode(&svg, NON_ALPHANUMERIC)
);
image.set_src(&svg_encoded);