From: Dave Mitchell Date: Thu, 4 Mar 2004 23:56:42 +0000 (+0000) Subject: ensure utf8::encode() normalises its arg X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=42b1db35bd6485f66426fa704408dc673fb999f1;p=p5sagit%2Fp5-mst-13.2.git ensure utf8::encode() normalises its arg p4raw-id: //depot/perl@22439 --- diff --git a/sv.c b/sv.c index dd15758..ed6051a 100644 --- a/sv.c +++ b/sv.c @@ -3470,13 +3470,13 @@ Perl_sv_utf8_upgrade_flags(pTHX_ register SV *sv, I32 flags) return len; } - if (SvUTF8(sv)) - return SvCUR(sv); - if (SvIsCOW(sv)) { sv_force_normal_flags(sv, 0); } + if (SvUTF8(sv)) + return SvCUR(sv); + if (PL_encoding && !(flags & SV_UTF8_NO_ENCODING)) sv_recode_to_utf8(sv, PL_encoding); else { /* Assume Latin-1/EBCDIC */