use Unicode::UTF8 qw[decode_utf8 encode_utf8];
    
    use warnings FATAL => 'utf8'; # fatalize encoding glitches
    $string = decode_utf8($octets);
    $octets = encode_utf8($string);
 
    $string = decode_utf8($octets);
    $string = decode_utf8($octets, $fallback);
Returns an decoded representation of $octets in UTF-8 encoding as a character string.
$fallback is an optional "CODE" reference which provides a error-handling mechanism, allowing customization of error handling. The default error-handling mechanism is to replace any ill-formed UTF-8 sequences or encoded code points which can't be interchanged with REPLACEMENT CHARACTER (U+FFFD).
    $string = $fallback->($octets, $is_usv, $position);
$fallback is invoked with three arguments: $octets, $is_usv and $position. $octets is a sequence of one or more octets containing the maximal subpart of the ill-formed subsequence or encoded code point which can't be interchanged. $is_usv is a boolean indicating whether or not $octets represent a encoded Unicode scalar value. $position is a unsigned integer containing the zero based octet position at which the error occurred within the octets provided to "decode_utf8()". $fallback must return a character string consisting of zero or more Unicode scalar values. Unicode scalar values consist of code points in the range U+0000..U+D7FF and U+E000..U+10FFFF.
    $octets = encode_utf8($string);
    $octets = encode_utf8($string, $fallback);
Returns an encoded representation of $string in UTF-8 encoding as an octet string.
$fallback is an optional "CODE" reference which provides a error-handling mechanism, allowing customization of error handling. The default error-handling mechanism is to replace any code points which can't be interchanged or represented in UTF-8 encoding form with REPLACEMENT CHARACTER (U+FFFD).
    $string = $fallback->($codepoint, $is_usv, $position);
$fallback is invoked with three arguments: $codepoint, $is_usv and $position. $codepoint is a unsigned integer containing the code point which can't be interchanged or represented in UTF-8 encoding form. $is_usv is a boolean indicating whether or not $codepoint is a Unicode scalar value. $position is a unsigned integer containing the zero based character position at which the error occurred within the string provided to "encode_utf8()". $fallback must return a character string consisting of zero or more Unicode scalar values.Unicode scalar values consist of code points in the range U+0000..U+D7FF and U+E000..U+10FFFF.
    $boolean = valid_utf8($octets);
Returns a boolean indicating whether or not the given $octets consist of well-formed UTF-8 sequences.
The sub-categories: "nonchar", "surrogate" and "non_unicode" is only available on Perl 5.14 or greater. See perllexwarn for available categories and hierarchies.
<http://github.com/chansen/p5-unicode-utf8>
    git clone http://github.com/chansen/p5-unicode-utf8
 
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.