if ( $string =~ /[\x80-\xff]/ ) { $string = decode( 'utf8', $string ); }