use strict; use warnings; use feature qw( say ); use open ':std', ':encoding(UTF-8)'; use Encode qw( decode ); $_ = "\xe4\xbb\x96"; say length; $_ = decode("UTF-8", $_); say length; $_ = decode("UTF-8", $_); # XXX Bug say length; #### 3 1 Cannot decode string with wide characters at [...].