diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-14 16:06:33 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-14 16:06:33 +0000 |
| commit | d1032e518e0c70f64efd68bde6c871d9310ba6f9 (patch) | |
| tree | 47cc804c9faf9827adaa3ed799fd2eacfd5c31f0 /transcode.c | |
| parent | 632c452e12dbefd160238ddaa2d0df0af77be8a7 (diff) | |
| download | ruby-d1032e518e0c70f64efd68bde6c871d9310ba6f9.tar.gz ruby-d1032e518e0c70f64efd68bde6c871d9310ba6f9.tar.xz ruby-d1032e518e0c70f64efd68bde6c871d9310ba6f9.zip | |
* transcode.c (econv_primitive_convert): set destination_buffer
encoding.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
| -rw-r--r-- | transcode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/transcode.c b/transcode.c index b8c8d1a1a..2e189b935 100644 --- a/transcode.c +++ b/transcode.c @@ -1676,6 +1676,10 @@ econv_primitive_convert(int argc, VALUE *argv, VALUE self) rb_str_set_len(output, op-(unsigned char *)RSTRING_PTR(output)); rb_str_drop_bytes(input, ip - (unsigned char *)RSTRING_PTR(input)); + if (ec->destination_encoding) { + rb_enc_associate(output, ec->destination_encoding); + } + switch (res) { case econv_invalid_byte_sequence: return ID2SYM(rb_intern("invalid_byte_sequence")); case econv_undefined_conversion: return ID2SYM(rb_intern("undefined_conversion")); |
