From d387e787124218534c72356e142ac78384380c85 Mon Sep 17 00:00:00 2001 From: Young-il Choi Date: Sun, 30 Jun 2013 22:15:03 +0900 Subject: [PATCH 1/2] librustc: back::link::sanitize support esacpe_utf8 --- src/librustc/back/link.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index cc062db4cb2..7954bc834f5 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -660,9 +660,9 @@ pub fn sanitize(s: &str) -> ~str { | '_' => result.push_char(c), _ => { - if c > 'z' && char::is_XID_continue(c) { - result.push_char(c); - } + let tstr = char::escape_unicode(c); + result.push_char('$'); + result.push_str(tstr.slice_from(1)); } } } From 567cf30450c4c1ff15938c9c6a2519440e47a00e Mon Sep 17 00:00:00 2001 From: Young-il Choi Date: Mon, 1 Jul 2013 16:11:32 +0900 Subject: [PATCH 2/2] librustc: apply changes of char::escape_unicode --- src/librustc/back/link.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs index 7954bc834f5..61d39421b7f 100644 --- a/src/librustc/back/link.rs +++ b/src/librustc/back/link.rs @@ -660,7 +660,8 @@ pub fn sanitize(s: &str) -> ~str { | '_' => result.push_char(c), _ => { - let tstr = char::escape_unicode(c); + let mut tstr = ~""; + do char::escape_unicode(c) |c| { tstr.push_char(c); } result.push_char('$'); result.push_str(tstr.slice_from(1)); }