Closed pooyamb closed 3 years ago
It looks like serializer is doing percent encoding twice.
Minimal reproducible test that fails:
#[derive(Debug, serde::Serialize, Deserialize, PartialEq)] struct Human { #[serde(rename = "full name")] name: String, } let human = Human { name: "John Doe".to_string(), }; let encoded = serde_qs::to_string(&human); assert_eq!( encoded .and_then(|string| serde_qs::from_str::<Human>(&string)) .unwrap(), human );
Cause: I guess it encodes the space in field's name to + and encodes it again later to %2B.
+
%2B
Thank you for reporting this, and especially for providing the helpful test case. Fixed this, and will be pushing a minor release with the fix.
It looks like serializer is doing percent encoding twice.
Minimal reproducible test that fails:
Cause: I guess it encodes the space in field's name to
+
and encodes it again later to%2B
.