diff --git a/ChangeLog b/ChangeLog index 61e95b794e..bc27f8b68c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Aug 26 00:36:01 2008 Tanaka Akira + + * io.c (io_fwrite): add TEXTMODE_NEWLINE_ENCODER to option for + rb_str_transcode. + Tue Aug 26 00:24:23 2008 Tanaka Akira * transcode.c (make_econv_exception): show readagain part for invalid diff --git a/io.c b/io.c index 6ca2f71f59..b06016d091 100644 --- a/io.c +++ b/io.c @@ -755,7 +755,12 @@ io_fwrite(VALUE str, rb_io_t *fptr) } if (!NIL_P(common_encoding)) { - str = rb_str_transcode(str, common_encoding, &fptr->encs.opts); + rb_econv_option_t ecopts = fptr->encs.opts; +#ifdef TEXTMODE_NEWLINE_ENCODER + if (NEED_NEWLINE_ENCODER(fptr)) + ecopts.flags |= TEXTMODE_NEWLINE_ENCODER; +#endif + str = rb_str_transcode(str, common_encoding, &ecopts); } if (fptr->writeconv) {