Skip to content

Commit 87a16f6

Browse files
committed
perldelta for the -CA -s interaction fix
1 parent 597f346 commit 87a16f6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pod/perldelta.pod

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,25 @@ manager will later use a regex to expand these into links.
366366

367367
=item *
368368

369+
The C<-CA> flag (or equivalently, the C<PERL_UNICODE=A> environment setting)
370+
tells perl to treat command-line arguments as UTF-8 strings. (See L<perlrun>
371+
for details.) However, this did not extend to the global variables implicitly
372+
created by the C<-s> option:
373+
374+
$ perl -CA -s -e 'printf "%vx\n", $_ for $foo, $ARGV[0]' -- -foo=é é
375+
c3.a9
376+
e9
377+
378+
Here C<$foo> would end up containing the two-byte UTF-8 representation of
379+
"LATIN SMALL LETTER E WITH ACUTE", but C<$ARGV[0]> would contain a single
380+
codepoint corresponding to U+00E9.
381+
382+
This has been fixed: If C<-CA> is in effect, options parsed by C<-s> are
383+
treated as UTF-8, too. In the example above, C<$foo> and C<$ARGV[0]> now both
384+
contain C<chr(0xE9)>. [GH #23377]
385+
386+
=item *
387+
369388
We have long claimed to support identifiers up to about 255 characters
370389
long. However this was actually true only for identifiers that
371390
consisted of only ASCII characters. The real upper limit was as few as

0 commit comments

Comments
 (0)