This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perluniintro: Suggest to use utf8::decode() instead heavy Encode when sequence of...
authorPali <pali@cpan.org>
Sun, 18 Sep 2016 15:44:22 +0000 (17:44 +0200)
committerKarl Williamson <khw@cpan.org>
Tue, 7 Feb 2017 03:09:23 +0000 (20:09 -0700)
pod/perluniintro.pod

index 308113d..d0ed3a0 100644 (file)
@@ -817,8 +817,8 @@ pack/unpack to convert to/from Unicode.
 If you have a sequence of bytes you B<know> is valid UTF-8,
 but Perl doesn't know it yet, you can make Perl a believer, too:
 
-    use Encode 'decode_utf8';
-    $Unicode = decode_utf8($bytes);
+    $Unicode = $bytes;
+    utf8::decode($Unicode);
 
 or: