aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--transcode.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index dd9bc0d1be..624aa45a20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;