# Perl joins a byte string and a character string without complaint: it reads
# each byte of the first as a Latin-1 character. Nothing raises; the text is wrong.
use strict;
use warnings;
use Encode qw(decode);
binmode STDOUT, ':encoding(UTF-8)';

my $bytes = "caf\xC3\xA9";            # read from a file, never decoded
my $chars = decode("UTF-8", $bytes);  # decoded

my $joined = "$bytes $chars";
print "  \"\$bytes \$chars\"     $joined\n";
print "  length             ", length($joined), "\n";
print "  \$bytes eq \$chars   ", ($bytes eq $chars ? "true" : "false"), "\n";
my %prices = ($chars => 3);
print "  \$prices{\$bytes}    ", (defined $prices{$bytes} ? $prices{$bytes} : "undef"), "\n";
