diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-01-05 16:47:54 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-01-05 16:47:54 -0800 |
commit | 492ebabafba699f4c29cfd76c551ec1f342f08e9 (patch) | |
tree | fb48f9b7584089e130a95747aa7dddcf4af66e4c /lib | |
parent | 1b3a61788ecdf8350861745c654a8e81a2fea890 (diff) | |
download | perl-492ebabafba699f4c29cfd76c551ec1f342f08e9.tar.gz |
[perl #91850] utf8::decode: croak for ro scalars
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utf8.t | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/utf8.t b/lib/utf8.t index b13bb5377d..e56eebf626 100644 --- a/lib/utf8.t +++ b/lib/utf8.t @@ -439,6 +439,17 @@ SKIP: { } { + # Make sure utf8::decode does not modify read-only scalars + # [perl #91850]. + + my $name = "\x{c3}\x{b3}"; + Internals::SvREADONLY($name, 1); + eval { utf8::decode($name) }; + like $@, qr/^Modification of a read-only/, + 'utf8::decode respects readonliness'; +} + +{ my $a = "456\xb6"; utf8::upgrade($a); |