- or download this
if ( /[^\x00-\x7f]/ ) # true if $_ contains any non-ascii character
- or download this
use Encode;
...
if ( $@ ) {
# Encode would fail/die if $_ was not a valid utf8 string
}
- or download this
my @bytes = unpack( "C*", $_ ); # break string into bytes
...
die "Incomplete multibyte char\n" if ( $width );
# get here if the string was valid utf8