use strict; use warnings; use Encode qw/encode_utf8/; use charnames qw/:full/; use 5.010; # nur fuer say() benoetigt my $chars = "\N{LATIN SMALL LETTER A WITH DIAERESIS}\N{LATIN SMALL LETTER O WITH DIAERESIS}"; my $bytes = encode_utf8 $chars; { use utf8; say 'With utf8'; say encode_utf8(uc($chars)), " ", uc($bytes); say encode_utf8(substr($chars, 0, 2)), " ", substr($bytes, 0, 2); } { no utf8; say 'Without utf8'; say encode_utf8(uc($chars)), " ", uc($bytes); say encode_utf8(substr($chars, 0, 2)), " ", substr($bytes, 0, 2); } __END__ With utf8 ÄÖ äö äö ä Without utf8 ÄÖ äö äö ä