Permalink
Browse files

Doc tweaks (and one code tweak) based on Philip Newton's comments.

p4raw-id: //depot/perl@18731
  • Loading branch information...
1 parent ce81ff1 commit 8aa8f774be44d46814d4ddbad03e302f1eb37338 @jhi jhi committed Feb 17, 2003
Showing with 25 additions and 35 deletions.
  1. +1 −1 locale.c
  2. +9 −10 pod/perlrun.pod
  3. +4 −10 pod/perlunicode.pod
  4. +9 −11 pod/perluniintro.pod
  5. +1 −2 pod/perlvar.pod
  6. +1 −1 util.c
View
@@ -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.
*/
View
@@ -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<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.
View
@@ -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<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 *
View
@@ -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<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:
View
@@ -1119,8 +1119,7 @@ B<-t> or B<-TU>). This variable is read-only.
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
View
2 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;

0 comments on commit 8aa8f77

Please sign in to comment.