using the Encode module you can easily encode in different encodings
eg,
my $str = "A string in Perl internal format ...."; my $octets = encode("utf-8",$str,Encode::FB_CROAK);
to check utf you can use the function
is_utf8($str,Encode::FB_CROAK)
ppant source share