Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Recommend :encoding(utf8) instead of :utf8 in perlunicode.pod #10804

Closed
p5pRT opened this issue Nov 7, 2010 · 4 comments
Closed

[PATCH] Recommend :encoding(utf8) instead of :utf8 in perlunicode.pod #10804

p5pRT opened this issue Nov 7, 2010 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 7, 2010

Migrated from rt.perl.org#78906 (status was 'resolved')

Searchable as RT78906$

@p5pRT
Copy link
Author

p5pRT commented Nov 7, 2010

From @ntyni

Reading input with the :utf8 layer can be unsafe, as discussed in
<http​://www.perlmonks.org/?node_id=644786>. Many parts of the
documentation were updated with commit 740d4bb,
follow the suit with perlunicode.pod.

Noticed by Vincent Lefevre in http​://bugs.debian.org/589730


pod/perlunicode.pod | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

Inline Patch
diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod
index b9a43c3..4b25c27 100644
--- a/pod/perlunicode.pod
+++ b/pod/perlunicode.pod
@@ -23,10 +23,14 @@ Read L<Unicode Security Considerations|http://www.unicode.org/reports/tr36>.
 
 Perl knows when a filehandle uses Perl's internal Unicode encodings
 (UTF-8, or UTF-EBCDIC if in EBCDIC) if the filehandle is opened with
-the ":utf8" layer.  Other encodings can be converted to Perl's
+the ":utf8" layer.  UTF-8 and other encodings can be converted to Perl's
 encoding on input or from Perl's encoding on output by use of the
 ":encoding(...)"  layer.  See L<open>.
 
+Note that the C<:utf8> layer does not validate byte sequences. For
+reading input, using C<:encoding(utf8)> instead of bare C<:utf8>, is
+strongly recommended.
+
 To indicate that Perl source itself is in UTF-8, use C<use utf8;>.
 
 =item Regular Expressions
-- 
1.7.2.3

@p5pRT
Copy link
Author

p5pRT commented May 20, 2011

From @jmdh

On Sun Nov 07 11​:24​:51 2010, ntyni@​debian.org wrote​:

Reading input with the :utf8 layer can be unsafe, as discussed in
<http​://www.perlmonks.org/?node_id=644786>. Many parts of the
documentation were updated with commit 740d4bb,
follow the suit with perlunicode.pod.

Noticed by Vincent Lefevre in http​://bugs.debian.org/589730
---
pod/perlunicode.pod | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod
index b9a43c3..4b25c27 100644
--- a/pod/perlunicode.pod
+++ b/pod/perlunicode.pod
@​@​ -23,10 +23,14 @​@​ Read L<Unicode Security
Considerations|http​://www.unicode.org/reports/tr36>.

Perl knows when a filehandle uses Perl's internal Unicode encodings
(UTF-8, or UTF-EBCDIC if in EBCDIC) if the filehandle is opened with
-the "​:utf8" layer. Other encodings can be converted to Perl's
+the "​:utf8" layer. UTF-8 and other encodings can be converted to
Perl's
encoding on input or from Perl's encoding on output by use of the
"​:encoding(...)" layer. See L<open>.

+Note that the C<​:utf8> layer does not validate byte sequences. For
+reading input, using C<​:encoding(utf8)> instead of bare C<​:utf8>, is
+strongly recommended.
+
To indicate that Perl source itself is in UTF-8, use C<use utf8;>.

=item Regular Expressions

A similar change which resolves this issue was applied in
4ee7c0e.

@p5pRT
Copy link
Author

p5pRT commented May 20, 2011

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 21, 2011

@cpansprout - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant