Skip to content

Commit b44953b

Browse files
committed
auto merge of #7488 : yichoi/rust/sanitize_utf8, r=huonw
back::link::sanitize support escape_utf8 fix #7486
2 parents 0bd67f6 + 567cf30 commit b44953b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc/back/link.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,10 @@ pub fn sanitize(s: &str) -> ~str {
660660
| '_' => result.push_char(c),
661661

662662
_ => {
663-
if c > 'z' && char::is_XID_continue(c) {
664-
result.push_char(c);
665-
}
663+
let mut tstr = ~"";
664+
do char::escape_unicode(c) |c| { tstr.push_char(c); }
665+
result.push_char('$');
666+
result.push_str(tstr.slice_from(1));
666667
}
667668
}
668669
}

0 commit comments

Comments
 (0)