diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-12-21 11:12:32 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-12-21 11:12:32 +0000 |
commit | 565a3db3dc85d0f63074b38e7019290e4f8f3766 (patch) | |
tree | f92dea6dde093732fde3a5a2dfa758a992949a1c /doop.c | |
parent | 27675a8e700ba7005e0a62604093abd3823685d5 (diff) | |
download | perl-565a3db3dc85d0f63074b38e7019290e4f8f3766.tar.gz |
Fix for [perl #37999] lc() + Latin-1 chars is failing erratically
based on copying part of change #22196 from do_chomp() to do_chop().
p4raw-link: @22196 on //depot/perl: a6aa349da2cd706a05b205fa788c278b74c24bdc
p4raw-id: //depot/perl@26431
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |