it overrides LC_MESSAGES for GNU gettext, and it also
can have more than one locale, separated by spaces,
in case you need to know.)
- If PL_utf8locale and PL_unicode (set by -C or by $ENV{PERL_UNICODE)
+ If PL_utf8locale and PL_unicode (set by -C or by $ENV{PERL_UNICODE})
are true, perl.c:S_parse_body() will turn on the PerlIO :utf8 layer
on STDIN, STDOUT, STDERR, _and_ the default open discipline.
*/
The C<-C> flag controls some Unicode of the Perl Unicode features.
As of 5.8.1, the C<-C> can be followed either by a number or a list
-of option letters. The letters and their numeric values are as follows;
-listing the letters is equal to summing the numbers.
+of option letters. The letters, their numeric values, and affects
+are as follows; listing the letters is equal to summing the numbers.
I 1 STDIN is assumed to be in UTF-8
O 2 STDOUT will be in UTF-8
STDOUT and STDERR. Repeating letters is just redundant, not cumulative
nor toggling.
-The C<-C> on its own (not followed by any number or option list),
-or an empty string as the C<$ENV{PERL_UNICODE}), has the same effect
+C<-C> on its own (not followed by any number or option list), or the
+empty string C<""> for the C<$ENV{PERL_UNICODE}, has the same effect
as <-CSDL>. In other words, the standard I/O handles and the default
C<open()> layer are UTF-8-fied B<but> only if the locale environment
-variables indicate a UTF-8 locale. This behavior follows the I<implicit>
-UTF-8 behaviour of Perl 5.8.0.
+variables indicate a UTF-8 locale. This behaviour follows the
+I<implicit> UTF-8 behaviour of Perl 5.8.0.
You can use C<-C0> to explicitly disable all the above Unicode features.
-See L<perluniintro>, L<perlfunc/open>, and L<open> for more information.
+See L<perlfunc/open>, and L<open> for more information.
-The read-only magic variable C<${^UNICODE}> reflects the state of this
-setting, see L<perlvar/"${^UNICODE}">. (Another way of setting this
-variable is to set the environment variable PERL_UNICODE.)
+The read-only magic variable C<${^UNICODE}> reflects the numeric value
+of this setting, see L<perlvar/"${^UNICODE}">.
(In Perls earlier than 5.8.1 the C<-C> switch was a Win32-only switch
that enabled the use of Unicode-aware "wide system call" Win32 APIs.
=item *
-If your locale environment variables (LC_ALL, LC_CTYPE, LANG) contain
-the strings 'UTF-8' or 'UTF8' (matched case-insensitively) B<and> you
-enable using UTF-8 either by using the C<-C> command line switch or
-setting the PERL_UNICODE environment variable to be, C<"L">, an empty
-string, (see L<perlrun> and the documentation for the C<-C> switch for
-more information about the possible values), then the default
-encodings of your STDIN, STDOUT, and STDERR, and of B<any subsequent
-file open>, are considered to be UTF-8. See L<perluniintro>,
-L<perlfunc/open>, and L<open> for more information. The magic
-variable C<${^UNICODE}> will also be set.
+You can enable automatic UTF-8-ification of your standard file
+handles, default C<open()> layer, and C<@ARGV> by using either
+the C<-C> command line switch or the C<PERL_UNICODE> environment
+variable, see L<perlrun> for the documentation of the C<-C> switch.
=item *
to this sample program ensures that the output is completely UTF-8,
and removes the program's warning.
-If your locale environment variables (C<LC_ALL>, C<LC_CTYPE>, C<LANG>)
-contain the strings 'UTF-8' or 'UTF8' (matched case-insensitively)
-B<and> you enable using UTF-8 either by using the C<-C> command line
-switch or by setting the PERL_UNICODE environment variable to an empty
-string, C<"">, (see L<perlrun> and the documentation for the C<-C>
-switch for more information about the possible values), then the
-default encoding of your STDIN, STDOUT, and STDERR, and of B<any
-subsequent file open>, will be UTF-8. Note that this means that Perl
-expects other software to work, too: if Perl has been led to believe
-that STDIN should be UTF-8, but then STDIN coming in from another
-command is not UTF-8, Perl will complain about the malformed UTF-8.
+You can enable automatic UTF-8-ification of your standard file
+handles, default C<open()> layer, and C<@ARGV> by using either
+the C<-C> command line switch or the C<PERL_UNICODE> environment
+variable, see L<perlrun> for the documentation of the C<-C> switch.
+
+Note that this means that Perl expects other software to work, too:
+if Perl has been led to believe that STDIN should be UTF-8, but then
+STDIN coming in from another command is not UTF-8, Perl will complain
+about the malformed UTF-8.
All features that combine Unicode and I/O also require using the new
PerlIO feature. Almost all Perl 5.8 platforms do use PerlIO, though:
Reflects certain Unicode settings of Perl. See L<perlrun> for more
information about the possible values. This variable is set during
-Perl startup and thereafter read-only. See L<perluniintro>,
-L<perlfunc/open>, and L<open> for more information.
+Perl startup and thereafter read-only.
=item $PERL_VERSION
opt = PERL_UNICODE_DEFAULT_FLAGS;
if (opt & ~PERL_UNICODE_ALL_FLAGS)
- Perl_croak(aTHX_ "Unknown Unicode option value 0x%"UVXf,
+ Perl_croak(aTHX_ "Unknown Unicode option value 0x%"IVdf,
(UV) (opt & ~PERL_UNICODE_ALL_FLAGS));
*popt = p;