From 0f172491d35eba0f0a4e70b2cf36103ecb382823 Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Sun, 1 May 2016 02:22:15 -0400 Subject: [PATCH] Add picking of encoding for url encoded data --- components/script/dom/htmlformelement.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index 4a289740e2a..a318b9d0006 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -321,7 +321,7 @@ impl HTMLFormElement { result.push_str(&*format!("\r\n--{}--", boundary)); - return result; + result } /// [Form submission](https://html.spec.whatwg.org/multipage/#concept-form-submit) @@ -377,6 +377,7 @@ impl HTMLFormElement { load_data.headers.set(ContentType::form_url_encoded()); form_urlencoded::Serializer::new(String::new()) + .encoding_override(Some(self.pick_encoding())) .extend_pairs(form_data.into_iter().map(|field| (field.name.clone(), field.value_str()))) .finish() }