escape non-ascii characters correctly in String#inspect

This commit is contained in:
h2so5
2014-01-21 21:36:59 +09:00
parent b3f8f8a5b0
commit a030cab7d1
+1 -1
View File
@@ -2412,7 +2412,7 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str)
p = RSTRING_PTR(str); pend = RSTRING_END(str);
for (;p < pend; p++) {
unsigned int c, cc;
unsigned char c, cc;
c = *p;
if (c == '"'|| c == '\\' || (c == '#' && IS_EVSTR(p, pend))) {