use Encode qw( _utf8_off ); my $x = chr(0x900); _utf8_off( $x ); # Get internal representation. print(length($x), "\n"); # 3