diff options
author | Nicholas Clark <nick@ccl4.org> | 2004-03-09 16:11:37 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2004-03-09 16:11:37 +0000 |
commit | 6aa2f6a7a4e2a0d061a689b227dcf063d93806a6 (patch) | |
tree | b1cdce1b0005b1331cebe2ac1c775d48ea999b01 /pp_sys.c | |
parent | 821bf9a5d89e1fc44be0165540e1f57de5c874e1 (diff) | |
download | perl-6aa2f6a7a4e2a0d061a689b227dcf063d93806a6.tar.gz |
Make a temporary copy of the input buffer in pp_send, so that send
and syswrite don't gratuitously upgrade their input to UTF8
p4raw-id: //depot/perl@22471
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1820,7 +1820,11 @@ PP(pp_send) } if (PerlIO_isutf8(IoIFP(io))) { - buffer = SvPVutf8(bufsv, blen); + if (!SvUTF8(bufsv)) { + bufsv = sv_2mortal(newSVsv(bufsv)); + buffer = sv_2pvutf8(bufsv, &blen); + } else + buffer = SvPV(bufsv, blen); } else { if (DO_UTF8(bufsv)) { |