diff options
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 |