diff --git a/ChangeLog b/ChangeLog index 93eb62d870..f988ad5175 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Sep 14 10:08:19 2009 NARUSE, Yui + + * string.c (rb_str_inspect): use rb_enc_mbc_to_codepoint + because we already knew char is found and got length. + Mon Sep 14 09:59:03 2009 NAKAMURA Usaku * include/ruby/ruby.h (NUM2INT, NUM2LL, INT2NUM, UINT2NUM), diff --git a/string.c b/string.c index aa36c37d72..9aea029fe5 100644 --- a/string.c +++ b/string.c @@ -4278,8 +4278,7 @@ rb_str_inspect(VALUE str) goto escape_codepoint; } n = MBCLEN_CHARFOUND_LEN(n); - - c = rb_enc_codepoint_len(p, pend, &n, enc); + c = rb_enc_mbc_to_codepoint(p, pend, enc); p += n; if (c == '"'|| c == '\\' || (c == '#' &&