diff options
Diffstat (limited to 'ext/nkf')
-rw-r--r-- | ext/nkf/nkf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/nkf/nkf.c b/ext/nkf/nkf.c index c64605b38..24761449d 100644 --- a/ext/nkf/nkf.c +++ b/ext/nkf/nkf.c @@ -169,7 +169,10 @@ rb_nkf_convert(VALUE obj, VALUE opt, VALUE src) rb_str_set_len(result, output_ctr); OBJ_INFECT(result, src); - rb_enc_associate(result, rb_nkf_enc_get(nkf_enc_name(output_encoding))); + if (mimeout_f) + rb_enc_associate(result, rb_usascii_encoding()); + else + rb_enc_associate(result, rb_nkf_enc_get(nkf_enc_name(output_encoding))); return result; } |