summaryrefslogtreecommitdiff
path: root/pod/perlunicode.pod
diff options
context:
space:
mode:
authorPali <pali@cpan.org>2016-09-18 17:25:48 +0200
committerKarl Williamson <khw@cpan.org>2017-01-26 07:15:57 -0700
commit8e179dd8df306c5088bf6c15b494826d48278928 (patch)
tree60a14b9430c26ca20d8dea45fc70ff758a06413e /pod/perlunicode.pod
parent96b108235b7a4c239dbc0251abf17c3ef015c4d8 (diff)
downloadperl-8e179dd8df306c5088bf6c15b494826d48278928.tar.gz
pod: Suggest to use strict UTF-8 encoding when dealing with external data
For data exchange it is not good idea to use not strict perl's extended dialect of utf8 encoding.
Diffstat (limited to 'pod/perlunicode.pod')
-rw-r--r--pod/perlunicode.pod8
1 files changed, 4 insertions, 4 deletions
diff --git a/pod/perlunicode.pod b/pod/perlunicode.pod
index 33e52b31b3..ba5e312d02 100644
--- a/pod/perlunicode.pod
+++ b/pod/perlunicode.pod
@@ -1904,7 +1904,7 @@ check the documentation to verify if this is still true.
if ($] > 5.008) {
require Encode;
- $val = Encode::encode_utf8($val); # make octets
+ $val = Encode::encode("UTF-8", $val); # make octets
}
=item *
@@ -1916,7 +1916,7 @@ want the UTF8 flag restored:
if ($] > 5.008) {
require Encode;
- $val = Encode::decode_utf8($val);
+ $val = Encode::decode("UTF-8", $val);
}
=item *
@@ -2017,8 +2017,8 @@ Perl's internal representation like so:
sub my_escape_html ($) {
my($what) = shift;
return unless defined $what;
- Encode::decode_utf8(Foo::Bar::escape_html(
- Encode::encode_utf8($what)));
+ Encode::decode("UTF-8", Foo::Bar::escape_html(
+ Encode::encode("UTF-8", $what)));
}
Sometimes, when the extension does not convert data but just stores