auto merge of #7488 : yichoi/rust/sanitize_utf8, r=huonw

back:🔗:sanitize support escape_utf8
fix #7486
This commit is contained in:
bors 2013-07-01 08:03:15 -07:00
commit b44953b8a3

View File

@ -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));
}
}
}