This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_sv_vcatpvfn_flags: handle mixed utf8 better
authorDavid Mitchell <davem@iabyn.com>
Fri, 2 Jun 2017 13:47:11 +0000 (14:47 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 7 Jun 2017 08:11:09 +0000 (09:11 +0100)
commitd0bb7cfbdb7926a11888ea9507c51285e51aa49f
tree466d04a5167fe3b232b858dbf65b70a09035060c
parent069f220916a5df0756a761e8e064076229b3e312
Perl_sv_vcatpvfn_flags: handle mixed utf8 better

Once the output string gets upgraded to utf8 (e.g. due to a utf8 %s
argument), any remaining appending of plain (non-%) parts of the
format string becomes very inefficient. It basically creates an
SV out of the next format chunk, upgrades that SV to utf8, then
appends the upgraded buffer.

This commits makes it just append the format chunk byte by byte, upgrading
in the fly if that byte is !NATIVE_BYTE_IS_INVARIANT
sv.c