diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index cc062db4cb2c9..61d39421b7fd0 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -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)); } } }