summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-12-11 22:37:40 +0000
committerNicholas Clark <nick@ccl4.org>2005-12-11 22:37:40 +0000
commit640283f5813252b086f0011a9256515389d5b6a6 (patch)
tree3505e3db56ae652508849001ba183367c2b54eb4 /sv.c
parent57c348a981665d6305f7f38920ab85e57a77ae65 (diff)
downloadperl-640283f5813252b086f0011a9256515389d5b6a6.tar.gz
Fix *printf %*vd with mixed Latin 1/UTF-8. (Fixes bug 37889)
p4raw-id: //depot/perl@26325
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index f48e886371..df957d51f3 100644
--- a/sv.c
+++ b/sv.c
@@ -7984,8 +7984,16 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
vecsv = svix < svmax ? svargs[svix++] : &PL_sv_undef;
}
dotstr = SvPV_const(vecsv, dotstrlen);
+ /* Keep the DO_UTF8 test *after* the SvPV call, else things go
+ bad with tied or overloaded values that return UTF8. */
if (DO_UTF8(vecsv))
is_utf8 = TRUE;
+ else if (has_utf8) {
+ vecsv = sv_mortalcopy(vecsv);
+ sv_utf8_upgrade(vecsv);
+ dotstr = SvPV_const(vecsv, dotstrlen);
+ is_utf8 = TRUE;
+ }
}
if (args) {
VECTORIZE_ARGS