From 1d0976c1925d0b3dadc458101d90c7664b0a35ce Mon Sep 17 00:00:00 2001 From: Prabhjyot Singh Sodhi Date: Thu, 30 Apr 2015 14:54:01 +0530 Subject: TextEncoder::Constructor should not trim whitespaces or lowercase labels #5900 Fixes #5900 --- components/script/dom/textencoder.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'components/script/dom/textencoder.rs') diff --git a/components/script/dom/textencoder.rs b/components/script/dom/textencoder.rs index 91a02257d71..03c4902ec11 100644 --- a/components/script/dom/textencoder.rs +++ b/components/script/dom/textencoder.rs @@ -14,7 +14,6 @@ use dom::bindings::utils::{Reflector, reflect_dom_object}; use util::str::DOMString; use std::borrow::ToOwned; -use std::ascii::AsciiExt; use std::ptr; use encoding::types::EncodingRef; @@ -50,7 +49,7 @@ impl TextEncoder { // https://encoding.spec.whatwg.org/#dom-textencoder pub fn Constructor(global: GlobalRef, label: DOMString) -> Fallible> { - let encoding = match encoding_from_whatwg_label(&label.trim().to_ascii_lowercase()) { + let encoding = match encoding_from_whatwg_label(&label) { Some(enc) => enc, None => { debug!("Encoding Label Not Supported"); -- cgit v1.2.3