summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-09-28 08:34:51 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-10-01 12:51:54 -0700
commit892f91270f2acad75eaf1abceabc8c50bf559b2d (patch)
treeb143ae196e5c720e8001565e75ea28d619319f93 /universal.c
parent76f7f4d6a8494f1c7f0987fadbb555eb5a1103a1 (diff)
downloadperl-892f91270f2acad75eaf1abceabc8c50bf559b2d.tar.gz
Make utf8::encode respect magic
It has always ignored set-magic, as far as I can tell. Since the magic flags patch (4bac9ae47b), it has been ignor- ing get- magic on magical scalars that were already PVs. sv_utf8_upgrade_flags_grow begins with an if(!SvPOK(sv)) check, which used to mean ‘if this scalar is magic or not a string’, but now means simply ‘if this scalar is not a string’. SvPOK_nog is the new SvPOK. Due to the way the flags now work, I had to modify sv_pvutf8n_force as well, to keep existing tests passing.
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/universal.c b/universal.c
index cb49e0b2f0..676c39b1e9 100644
--- a/universal.c
+++ b/universal.c
@@ -808,6 +808,7 @@ XS(XS_utf8_encode)
if (items != 1)
croak_xs_usage(cv, "sv");
sv_utf8_encode(ST(0));
+ SvSETMAGIC(ST(0));
XSRETURN_EMPTY;
}