in reply to Encode::decode issue with string

It works for me.
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use Encode qw{ decode }; my %utf8 = ( japanese => "\xe6\x84\x9b", chinese => "\xe5\x92\x8c\xe5\xb9\xb3", spanish => "\x61\x6c\x65\x67\x72\xc3\xad\x61"); binmode STDOUT, ':encoding(UTF-8)'; for my $language (keys %utf8) { my $decoded = decode('UTF-8', $utf8{$language}); say join ', ', $language, length $decoded, $decoded; }

Output (on a UTF-8 terminal):

chinese, 2, 和平
japanese, 1, 愛
spanish, 7, alegrķa
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]