summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-05 16:47:54 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-05 16:47:54 -0800
commit492ebabafba699f4c29cfd76c551ec1f342f08e9 (patch)
treefb48f9b7584089e130a95747aa7dddcf4af66e4c /lib
parent1b3a61788ecdf8350861745c654a8e81a2fea890 (diff)
downloadperl-492ebabafba699f4c29cfd76c551ec1f342f08e9.tar.gz
[perl #91850] utf8::decode: croak for ro scalars
Diffstat (limited to 'lib')
-rw-r--r--lib/utf8.t11
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);