X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=doop.c;h=09cb6f531024552280947ad376eb01be824e20f1;hb=4df4e287246babaf287cf6336ca862ceeead8e46;hp=c23093caf079e365cc3acee9b16e51c07a052942;hpb=1a787b952b2a283c0366c148171c3bc150e9489a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/doop.c b/doop.c index c23093c..09cb6f5 100644 --- a/doop.c +++ b/doop.c @@ -967,6 +967,13 @@ Perl_do_chop(pTHX_ register SV *astr, register SV *sv) if (SvREADONLY(sv)) Perl_croak(aTHX_ PL_no_modify); } + + if (PL_encoding && !SvUTF8(sv)) { + /* like in do_chomp(), utf8-ize the sv as a side-effect + * if we're using encoding. */ + sv_recode_to_utf8(sv, PL_encoding); + } + s = SvPV(sv, len); if (len && !SvPOK(sv)) s = SvPV_force(sv, len);