1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
akr 2008-08-24 06:44:21 +00:00
parent c6d291b003
commit b47c46106a
2 changed files with 9 additions and 1 deletions

View file

@ -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.

View file

@ -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;