summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/encoding.c b/encoding.c
index 244ef05f5e1..e1b14dcda5d 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1023,11 +1023,10 @@ rb_enc_tolower(int c, rb_encoding *enc)
static VALUE
enc_inspect(VALUE self)
{
- VALUE str = rb_sprintf("#<%s:%s%s>", rb_obj_classname(self),
- rb_enc_name((rb_encoding*)DATA_PTR(self)),
- (enc_dummy_p(self) ? " (dummy)" : ""));
- ENCODING_CODERANGE_SET(str, ENCINDEX_US_ASCII, ENC_CODERANGE_7BIT);
- return str;
+ return rb_enc_sprintf(rb_usascii_encoding(),
+ "#<%"PRIsVALUE":%s%s>", rb_obj_class(self),
+ rb_enc_name((rb_encoding*)DATA_PTR(self)),
+ (enc_dummy_p(self) ? " (dummy)" : ""));
}
/*