diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-24 06:44:21 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-24 06:44:21 +0000 |
| commit | c9784660bea081c21bd2f96a6c5c17ddc91175a4 (patch) | |
| tree | d3cc674fa7b89831c5e59b526aef70712dfe26cc | |
| parent | e9c33b3630cd4d2c32645ce28e8854040831311a (diff) | |
| download | ruby-c9784660bea081c21bd2f96a6c5c17ddc91175a4.tar.gz ruby-c9784660bea081c21bd2f96a6c5c17ddc91175a4.tar.xz ruby-c9784660bea081c21bd2f96a6c5c17ddc91175a4.zip | |
* transcode.c (rb_econv_substr_append): associate dst with destination
encoding when dst is created.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | transcode.c | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Sun Aug 24 15:43:41 2008 Tanaka Akira <akr@fsij.org> + + * transcode.c (rb_econv_substr_append): associate dst with destination + encoding when dst is created. + Sun Aug 24 15:21:28 2008 Tanaka Akira <akr@fsij.org> * include/ruby/encoding.h (rb_str_transcode): add ecflags argument. diff --git a/transcode.c b/transcode.c index 9c4b9644e..fdabb2fd1 100644 --- a/transcode.c +++ b/transcode.c @@ -1334,8 +1334,11 @@ rb_econv_substr_append(rb_econv_t *ec, VALUE src, long off, long len, VALUE dst, rb_econv_result_t res; int max_output; - if (NIL_P(dst)) + if (NIL_P(dst)) { dst = rb_str_buf_new(len); + if (ec->destination_encoding) + rb_enc_associate(dst, ec->destination_encoding); + } if (ec->last_tc) max_output = ec->last_tc->transcoder->max_output; |
