aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index b716c16b15..a6f8bf1160 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;
}
}