diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-23 20:13:55 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-23 20:13:55 +0000 |
| commit | 87664e799f6c4782937ec8154f73e7230e6268a7 (patch) | |
| tree | 84513771aaafdcf3e9849e5f7aa01bd880d86fba /string.c | |
| parent | 48247186ba43ccb221c2984ae3d1e12026ad6a5b (diff) | |
| download | ruby-87664e799f6c4782937ec8154f73e7230e6268a7.tar.gz ruby-87664e799f6c4782937ec8154f73e7230e6268a7.tar.xz ruby-87664e799f6c4782937ec8154f73e7230e6268a7.zip | |
* string.c (tr_trans): should associate new encoding if modified.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -3654,8 +3654,11 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag) STR_SET_NOEMBED(str); RSTRING(str)->as.heap.aux.capa = max; } - - if (modify) return str; + + if (modify) { + rb_enc_associate(str, enc); + return str; + } return Qnil; } |
