From 8aa8f774be44d46814d4ddbad03e302f1eb37338 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Mon, 17 Feb 2003 05:31:18 +0000 Subject: [PATCH] Doc tweaks (and one code tweak) based on Philip Newton's comments. p4raw-id: //depot/perl@18731 --- locale.c | 2 +- pod/perlrun.pod | 19 +++++++++---------- pod/perlunicode.pod | 14 ++++---------- pod/perluniintro.pod | 20 +++++++++----------- pod/perlvar.pod | 3 +-- util.c | 2 +- 6 files changed, 25 insertions(+), 35 deletions(-) diff --git a/locale.c b/locale.c index b00828c..9c41710 100644 --- a/locale.c +++ b/locale.c @@ -487,7 +487,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn) 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. */ diff --git a/pod/perlrun.pod b/pod/perlrun.pod index e38ad3d..a83acd6 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -270,8 +270,8 @@ An alternate delimiter may be specified using B<-F>. 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 @@ -291,20 +291,19 @@ For example, C<-COE> and C<-C6> will both turn on UTF-8-ness on both 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 layer are UTF-8-fied B only if the locale environment -variables indicate a UTF-8 locale. This behavior follows the I -UTF-8 behaviour of Perl 5.8.0. +variables indicate a UTF-8 locale. This behaviour follows the +I UTF-8 behaviour of Perl 5.8.0. You can use C<-C0> to explicitly disable all the above Unicode features. -See L, L, and L for more information. +See L, and L for more information. -The read-only magic variable C<${^UNICODE}> reflects the state of this -setting, see L. (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. (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. diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod index 95d4857..7df28e2 100644 --- a/pod/perlunicode.pod +++ b/pod/perlunicode.pod @@ -1043,16 +1043,10 @@ there are a couple of exceptions: =item * -If your locale environment variables (LC_ALL, LC_CTYPE, LANG) contain -the strings 'UTF-8' or 'UTF8' (matched case-insensitively) B 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 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, are considered to be UTF-8. See L, -L, and L 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 layer, and C<@ARGV> by using either +the C<-C> command line switch or the C environment +variable, see L for the documentation of the C<-C> switch. =item * diff --git a/pod/perluniintro.pod b/pod/perluniintro.pod index 33400fc..f18cdee 100644 --- a/pod/perluniintro.pod +++ b/pod/perluniintro.pod @@ -172,17 +172,15 @@ To output UTF-8, use the C<:utf8> output layer. Prepending to this sample program ensures that the output is completely UTF-8, and removes the program's warning. -If your locale environment variables (C, C, C) -contain the strings 'UTF-8' or 'UTF8' (matched case-insensitively) -B 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 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, 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 layer, and C<@ARGV> by using either +the C<-C> command line switch or the C environment +variable, see L 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: diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 6790244..4d1a31b 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -1119,8 +1119,7 @@ B<-t> or B<-TU>). This variable is read-only. Reflects certain Unicode settings of Perl. See L for more information about the possible values. This variable is set during -Perl startup and thereafter read-only. See L, -L, and L for more information. +Perl startup and thereafter read-only. =item $PERL_VERSION diff --git a/util.c b/util.c index d5cc256..9720ce7 100644 --- a/util.c +++ b/util.c @@ -4357,7 +4357,7 @@ Perl_parse_unicode_opts(pTHX_ char **popt) 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; -- 2.7.4