Skip to content

Commit

Permalink
auto merge of #7488 : yichoi/rust/sanitize_utf8, r=huonw
Browse files Browse the repository at this point in the history
back::link::sanitize support escape_utf8
fix #7486
  • Loading branch information
bors committed Jul 1, 2013
2 parents 0bd67f6 + 567cf30 commit b44953b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,10 @@ pub fn sanitize(s: &str) -> ~str {
| '_' => result.push_char(c),

_ => {
if c > 'z' && char::is_XID_continue(c) {
result.push_char(c);
}
let mut tstr = ~"";
do char::escape_unicode(c) |c| { tstr.push_char(c); }
result.push_char('$');
result.push_str(tstr.slice_from(1));
}
}
}
Expand Down

0 comments on commit b44953b

Please sign in to comment.