diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-12-11 22:37:40 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-12-11 22:37:40 +0000 |
commit | 640283f5813252b086f0011a9256515389d5b6a6 (patch) | |
tree | 3505e3db56ae652508849001ba183367c2b54eb4 /sv.c | |
parent | 57c348a981665d6305f7f38920ab85e57a77ae65 (diff) | |
download | perl-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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 |