diff --git a/time.c b/time.c index da8feb7bf3..ddd011ed79 100644 --- a/time.c +++ b/time.c @@ -4145,7 +4145,7 @@ time_inspect(VALUE time) } else if (FIXNUM_P(subsec) && FIX2LONG(subsec) < TIME_SCALE) { long len; - str = rb_enc_sprintf(rb_usascii_encoding(), "%"PRIsVALUE".%09ld", str, FIX2LONG(subsec)); + rb_str_catf(str, ".%09ld", FIX2LONG(subsec)); for (len=RSTRING_LEN(str); RSTRING_PTR(str)[len-1] == '0' && len > 0; len--) ; rb_str_resize(str, len);