#!/usr/bin/perl

# Idiom #287 Number of bytes of a string

use v5.10;
use charnames qw( :full );
use Encode;

binmode STDOUT, ':utf8';

my $text = "\N{LATIN SMALL LETTER E WITH ACUTE}";
say length $text;  # 1

my $utf8 = Encode::encode('UTF-8', $text);
say length $utf8;  # 2
