auto merge of #7488 : yichoi/rust/sanitize_utf8, r=huonw
back:🔗:sanitize support escape_utf8 fix #7486
This commit is contained in:
commit
b44953b8a3
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user