diff options
author | Pali <pali@cpan.org> | 2016-09-18 17:19:59 +0200 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-02-06 20:09:22 -0700 |
commit | 6d8e74506f971081362433e3d39fe2e4da9fb302 (patch) | |
tree | 92d34f6ffce0728d9ece2ad8c7c52d3d6a9287c9 /lib | |
parent | 42e9b60980bb8e29e76629e14c6aa945194c0647 (diff) | |
download | perl-6d8e74506f971081362433e3d39fe2e4da9fb302.tar.gz |
pod: Suggest to use strict :encoding(UTF-8) PerlIO layer over not strict :encoding(utf8)
For data exchange it is better to use strict UTF-8 encoding and not perl's utf8.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PerlIO.pm | 4 | ||||
-rw-r--r-- | lib/open.pm | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/PerlIO.pm b/lib/PerlIO.pm index 2e27f98bba..7658ce497b 100644 --- a/lib/PerlIO.pm +++ b/lib/PerlIO.pm @@ -1,6 +1,6 @@ package PerlIO; -our $VERSION = '1.09'; +our $VERSION = '1.10'; # Map layer name to package that defines it our %alias; @@ -104,7 +104,7 @@ is chosen to render simple text parts (i.e. non-accented letters, digits and common punctuation) human readable in the encoded file. (B<CAUTION>: This layer does not validate byte sequences. For reading input, -you should instead use C<:encoding(utf8)> instead of bare C<:utf8>.) +you should instead use C<:encoding(UTF-8)> instead of bare C<:utf8>.) Here is how to write your native data out using UTF-8 (or UTF-EBCDIC) and then read it back in. diff --git a/lib/open.pm b/lib/open.pm index fd22e1b9e7..ca3cf7b409 100644 --- a/lib/open.pm +++ b/lib/open.pm @@ -1,7 +1,7 @@ package open; use warnings; -our $VERSION = '1.10'; +our $VERSION = '1.11'; require 5.008001; # for PerlIO::get_layers() @@ -153,7 +153,7 @@ open - perl pragma to set default PerlIO layers for input and output use open IO => ':locale'; - use open ':encoding(utf8)'; + use open ':encoding(UTF-8)'; use open ':locale'; use open ':encoding(iso-8859-7)'; @@ -195,8 +195,8 @@ For example: These are equivalent - use open ':encoding(utf8)'; - use open IO => ':encoding(utf8)'; + use open ':encoding(UTF-8)'; + use open IO => ':encoding(UTF-8)'; as are these @@ -221,8 +221,8 @@ The C<:std> subpragma on its own has no effect, but if combined with the C<:utf8> or C<:encoding> subpragmas, it converts the standard filehandles (STDIN, STDOUT, STDERR) to comply with encoding selected for input/output handles. For example, if both input and out are -chosen to be C<:encoding(utf8)>, a C<:std> will mean that STDIN, STDOUT, -and STDERR are also in C<:encoding(utf8)>. On the other hand, if only +chosen to be C<:encoding(UTF-8)>, a C<:std> will mean that STDIN, STDOUT, +and STDERR are also in C<:encoding(UTF-8)>. On the other hand, if only output is chosen to be in C<< :encoding(koi8r) >>, a C<:std> will cause only the STDOUT and STDERR to be in C<koi8r>. The C<:locale> subpragma implicitly turns on C<:std>. |