* io.c (io_fwrite): add TEXTMODE_NEWLINE_ENCODER to option for

rb_str_transcode.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-08-25 15:37:04 +00:00
parent 86154f63b3
commit 6c1190d10f
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Tue Aug 26 00:36:01 2008 Tanaka Akira <akr@fsij.org>
* io.c (io_fwrite): add TEXTMODE_NEWLINE_ENCODER to option for
rb_str_transcode.
Tue Aug 26 00:24:23 2008 Tanaka Akira <akr@fsij.org>
* transcode.c (make_econv_exception): show readagain part for invalid

7
io.c
View File

@ -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) {