summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/doio.c b/doio.c
index 901ca718d0..d8168e1636 100644
--- a/doio.c
+++ b/doio.c
@@ -1148,12 +1148,14 @@ Perl_do_print(pTHX_ register SV *sv, PerlIO *fp)
}
/* FALL THROUGH */
default:
-#if 0
- /* XXX Fix this when the I/O disciplines arrive. XXX */
- if (DO_UTF8(sv))
- sv_utf8_downgrade(sv, FALSE);
-#endif
- tmps = SvPV(sv, len);
+ if (PerlIO_isutf8(fp)) {
+ tmps = SvPVutf8(sv, len);
+ }
+ else {
+ if (DO_UTF8(sv))
+ sv_utf8_downgrade(sv, FALSE);
+ tmps = SvPV(sv, len);
+ }
break;
}
/* To detect whether the process is about to overstep its