diff --git a/Cargo.lock b/Cargo.lock index d90659660..78ab0e924 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1753,70 +1753,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2153bd83ebc09db15bcbdc3e2194d901804952e3dc96967e1cd3b0c5c32d112" -[[package]] -name = "encoding" -version = "0.2.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" -dependencies = [ - "encoding-index-japanese", - "encoding-index-korean", - "encoding-index-simpchinese", - "encoding-index-singlebyte", - "encoding-index-tradchinese", -] - -[[package]] -name = "encoding-index-japanese" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-korean" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-simpchinese" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-singlebyte" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding-index-tradchinese" -version = "1.20141219.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" -dependencies = [ - "encoding_index_tests", -] - -[[package]] -name = "encoding_index_tests" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" - [[package]] name = "encoding_rs" version = "0.8.34" @@ -2762,7 +2698,7 @@ dependencies = [ "actix-web", "anyhow", "chrono", - "encoding", + "encoding_rs", "enum-map", "futures", "getrandom", diff --git a/crates/api_common/Cargo.toml b/crates/api_common/Cargo.toml index 9b196c426..4033b4130 100644 --- a/crates/api_common/Cargo.toml +++ b/crates/api_common/Cargo.toml @@ -25,7 +25,7 @@ full = [ "lemmy_db_views_moderator/full", "lemmy_utils/full", "activitypub_federation", - "encoding", + "encoding_rs", "reqwest-middleware", "webpage", "ts-rs", @@ -69,7 +69,7 @@ mime = { version = "0.3.17", optional = true } webpage = { version = "1.6", default-features = false, features = [ "serde", ], optional = true } -encoding = { version = "0.2.33", optional = true } +encoding_rs = { version = "0.8.34", optional = true } jsonwebtoken = { version = "8.3.0", optional = true } # necessary for wasmt compilation getrandom = { version = "0.2.14", features = ["js"] } diff --git a/crates/api_common/src/request.rs b/crates/api_common/src/request.rs index abf99f670..a2720998b 100644 --- a/crates/api_common/src/request.rs +++ b/crates/api_common/src/request.rs @@ -6,7 +6,7 @@ use crate::{ utils::{local_site_opt_to_sensitive, proxy_image_link, proxy_image_link_opt_apub}, }; use activitypub_federation::config::Data; -use encoding::{all::encodings, DecoderTrap}; +use encoding_rs::{Encoding, UTF_8}; use lemmy_db_schema::{ newtypes::DbUrl, source::{ @@ -160,11 +160,9 @@ fn extract_opengraph_data(html_bytes: &[u8], url: &Url) -> LemmyResult