aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/parse/html.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-10-17 15:12:35 +0200
committerMs2ger <ms2ger@gmail.com>2014-10-19 13:18:25 +0200
commitb9d853376008b9439f5d0ac60d23580df7bd7ad5 (patch)
tree00279d61c9113a08fc218b57a3d6043dc9cb47c8 /components/script/parse/html.rs
parent65856dd00a7da07ece8d3e1e63bc495943266a24 (diff)
downloadservo-b9d853376008b9439f5d0ac60d23580df7bd7ad5.tar.gz
servo-b9d853376008b9439f5d0ac60d23580df7bd7ad5.zip
Don't crash on invalid utf-8 in the HTML parser.
This was regressed by the html5ever landing.
Diffstat (limited to 'components/script/parse/html.rs')
-rw-r--r--components/script/parse/html.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs
index 829d5d0c40b..933202e81f6 100644
--- a/components/script/parse/html.rs
+++ b/components/script/parse/html.rs
@@ -496,7 +496,7 @@ pub fn parse_html(page: &Page,
match msg {
Payload(data) => {
// FIXME: use Vec<u8> (html5ever #34)
- let data = String::from_utf8(data).unwrap();
+ let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();
parser.tokenizer().borrow_mut().feed(data);
}
Done(Err(err)) => {