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 | b47c46106a0e2937d059e81b6fbecafe3a3d4347 (patch) | |
| tree | d3cc674fa7b89831c5e59b526aef70712dfe26cc | |
| parent | c6d291b003a4d5f8b12d9ff79767525d359b5733 (diff) | |
* transcode.c (rb_econv_substr_append): associate dst with destination
encoding when dst is created.
git-svn-id: svn+ssh://ci.ruby-lang.org/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 9c4b9644e3..fdabb2fd13 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; |
