This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Set %ENV keys using the same byte-string logic as setting %ENV values.
authorFelipe Gasper <felipe@felipegasper.com>
Sat, 10 Apr 2021 03:08:39 +0000 (23:08 -0400)
committerKarl Williamson <khw@cpan.org>
Fri, 16 Apr 2021 23:11:31 +0000 (17:11 -0600)
commit50352f1687ab2f02685a380668c889111cdeeee9
tree394c42dc6affad5d3729a7f58b694f3e2d67f243
parent3e22b590c6d72471558aaf41940c266859f988b8
Set %ENV keys using the same byte-string logic as setting %ENV values.

Issue #18636: This extends the work from
613c63b465f01af4e535fdc6c1c17e7470be5aad to %ENV keys. Previously
if you assigned an upgraded string as a key in %ENV, the string’s
internal PV representation was sent to the OS. Now the string is
“soft downgraded” before being given to the OS; if the downgrade
fails--i.e., if the string contains code points above 255--then
a warning is printed, and the string’s utf8 is assigned to the
environment, as happens with %ENV values.

A new internal macro, MgSV, is created to facilitate this work.
mg.c
mg.h
pod/perldelta.pod
t/op/magic.t