summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-30 08:30:35 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-30 08:30:35 +0000
commitf0720f70fca1466afb0baffc79f6af7a9e80f428 (patch)
tree5f84f35ed750de7ac065a725050b8356cbab4fc0 /perlio.c
parentabc718f2ca5cfe66c838e1324c1c153a085fea8b (diff)
downloadperl-f0720f70fca1466afb0baffc79f6af7a9e80f428.tar.gz
When dup'ing a filehandle, retain the :utf8 layer
p4raw-id: //depot/perl@30781
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/perlio.c b/perlio.c
index ef07055ef8..bbb12db702 100644
--- a/perlio.c
+++ b/perlio.c
@@ -2268,6 +2268,8 @@ PerlIOBase_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags)
if (self->Getarg)
arg = (*self->Getarg)(aTHX_ o, param, flags);
f = PerlIO_push(aTHX_ f, self, PerlIO_modestr(o,buf), arg);
+ if (PerlIOBase(o)->flags & PERLIO_F_UTF8)
+ PerlIOBase(f)->flags |= PERLIO_F_UTF8;
if (arg)
SvREFCNT_dec(arg);
}