New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encode() with FB_CROAK may destroy its argument #9391
Comments
From alex@kapranoff.ruCreated by alex@kapranoff.ruStandard Encode::encode() function with non-FB_DEFAULT argument use Encode; my $s = 'test'; my $enc = find_encoding('utf-7'); $enc->encode($s); $enc->encode($s, Encode::FB_CROAK | Encode::LEAVE_SRC); Encode POD suggests using LEAVE_SRC bit, but it's not used inside Here's a patch against bleadperl as of today: Inline Patch--- UTF7.pm.orig 2008-06-25 16:25:57.000000000 +0400
+++ UTF7.pm 2008-06-25 17:01:58.000000000 +0400
@@ -52,7 +52,7 @@
die "This should not happen! (pos=" . pos($str) . ")";
}
}
- $_[1] = '' if $chk;
+ $_[1] = '' if $chk && ($chk & Encode::LEAVE_SRC) == 0;
return $bytes;
} Perl Info
|
From @jkeenanOn Wed Jun 25 06:07:14 2008, kappa wrote:
Is this the same issue that was addressed in And, since we're on the subject of Encode and FB_CROAK, is it related to Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @rjbsThis bug is *NOT* the same as It does not appear to be related to The problem APPEARS to be that the user is relying on the $check The following simplified test passes, showing that the semantics for use Encode; I believe this is a non-bug. |
@cpansprout - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#56340 (status was 'rejected')
Searchable as RT56340$
The text was updated successfully, but these errors were encountered: