Created
June 16, 2014 20:04
-
-
Save autarch/84c2699de225d65102ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use v5.14; | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use Encode qw( decode encode is_utf8 ); | |
| my $bytes = join q{}, map { chr($_) } 240, 159, 152, 184; | |
| say $bytes; | |
| my $unicode = decode( 'utf-8', $bytes ); | |
| my $maybe_utf8 = "$bytes $unicode"; | |
| say is_utf8($maybe_utf8) ? 'yes' : 'no'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment