From 401874e72b3fe322a2137f4f48963ad037b016cb Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 9 Dec 2007 21:48:05 +0000 Subject: * re.c (rb_reg_expr_str): use \xHH instead of \OOO. * regerror.c (to_ascii): ditto. (onig_snprintf_with_pattern): ditto. (onig_snprintf_with_pattern): ditto. * string.c (rb_str_inspect): ditto. (rb_str_dump): ditto. * parse.y (parser_yylex): ditto. * ruby.c (proc_options): ditto. * file.c (rb_f_test): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index b716c16b1..a6f8bf116 100644 --- a/string.c +++ b/string.c @@ -2971,7 +2971,7 @@ rb_str_inspect(VALUE str) escape_codepoint: for (q = p-n; q < p; q++) { s = buf; - sprintf(buf, "\\%03o", *q & 0377); + sprintf(buf, "\\x%02x", *q & 0377); while (*s) { str_cat_char(result, *s++, enc); } @@ -3083,7 +3083,7 @@ rb_str_dump(VALUE str) } else { *q++ = '\\'; - sprintf(q, "%03o", c&0xff); + sprintf(q, "x%02x", c&0xff); q += 3; } } -- cgit