Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace surrogates in JS strings with U+FFFD instead of panicking. #6595

Merged
merged 1 commit into from Jul 11, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Replace surrogates in JS strings with U+FFFD instead of panicking.

Fix #6519.
See #6564.
  • Loading branch information
SimonSapin committed Jul 11, 2015
commit 3f07f8e8661e7ebd451af3aef247212708083bc5
@@ -355,7 +355,9 @@ pub fn jsstring_to_str(cx: *mut JSContext, s: *mut JSString) -> DOMString {
let char_vec = unsafe {
slice::from_raw_parts(chars as *const u16, length as usize)
};
String::from_utf16(char_vec).unwrap()
// This is a wilful spec violation.
// See https://github.com/servo/servo/issues/6564
String::from_utf16_lossy(char_vec)
}
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.