summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/io.c b/io.c
index ab3f35f3cf..5d3c17e2fe 100644
--- a/io.c
+++ b/io.c
@@ -910,7 +910,9 @@ make_writeconv(rb_io_t *fptr)
ecopts = fptr->encs.ecopts;
#ifdef TEXTMODE_NEWLINE_DECORATOR_ON_WRITE
if (NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) &&
- !(ecflags & ECONV_NEWLINE_DECORATOR_MASK))
+ (!(ecflags & ECONV_NEWLINE_DECORATOR_MASK)) ||
+ (ecflags & ECONV_UNIVERSAL_NEWLINE_DECORATOR))
+ ecflags &= ~ECONV_UNIVERSAL_NEWLINE_DECORATOR;
ecflags |= TEXTMODE_NEWLINE_DECORATOR_ON_WRITE;
#endif