This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix warn to respect utf8-encoded scalars [perl #45549]
[perl5.git] / util.c
diff --git a/util.c b/util.c
index 1809f70..2ab14d7 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1399,10 +1399,8 @@ Perl_write_to_stderr(pTHX_ SV* msv)
        dSAVED_ERRNO;
 #endif
        PerlIO * const serr = Perl_error_log;
-       STRLEN msglen;
-       const char* message = SvPVx_const(msv, msglen);
 
-       PERL_WRITE_MSG_TO_CONSOLE(serr, message, msglen);
+       do_print(msv, serr);
        (void)PerlIO_flush(serr);
 #ifdef USE_SFIO
        RESTORE_ERRNO;