+ # throw an exception if not representable as octets
+ utf8::downgrade($string)
+
+ # or do your own error handling
+ utf8::downgrade($string, 1) or die "string must be octets";
+
+B<Note that this function does not handle arbitrary encodings>;
+use L<Encode> instead.
+
+=item * C<utf8::encode($string)>
+
+(Since Perl v5.8.0)
+Converts in-place the character sequence to the corresponding octet
+sequence in Perl's extended UTF-8. That is, every (possibly wide) character
+gets replaced with a sequence of one or more characters that represent the
+individual UTF-8 bytes of the character. The UTF8 flag is turned off.
+Returns nothing.
+
+ my $x = "\x{100}"; # $x contains one character, with ord 0x100
+ utf8::encode($x); # $x contains two characters, with ords (on
+ # ASCII platforms) 0xc4 and 0x80. On EBCDIC
+ # 1047, this would instead be 0x8C and 0x41.
+
+Similar to:
+
+ use Encode;
+ $x = Encode::encode("utf8", $x);
+
+B<Note that this function does not handle arbitrary encodings>;
+use L<Encode> instead.
+
+=item * C<$success = utf8::decode($string)>
+
+(Since Perl v5.8.0)
+Attempts to convert in-place the octet sequence encoded in Perl's extended
+UTF-8 to the corresponding character sequence. That is, it replaces each
+sequence of characters in the string whose ords represent a valid (extended)
+UTF-8 byte sequence, with the corresponding single character. The UTF-8 flag
+is turned on only if the source string contains multiple-byte UTF-8
+characters. If I<$string> is invalid as extended UTF-8, returns false;
+otherwise returns true.
+
+ my $x = "\xc4\x80"; # $x contains two characters, with ords
+ # 0xc4 and 0x80
+ utf8::decode($x); # On ASCII platforms, $x contains one char,
+ # with ord 0x100. Since these bytes aren't
+ # legal UTF-EBCDIC, on EBCDIC platforms, $x is
+ # unchanged and the function returns FALSE.
+
+B<Note that this function does not handle arbitrary encodings>;
+use L<Encode> instead.
+
+=item * C<$unicode = utf8::native_to_unicode($code_point)>
+
+(Since Perl v5.8.0)
+This takes an unsigned integer (which represents the ordinal number of a
+character (or a code point) on the platform the program is being run on) and
+returns its Unicode equivalent value. Since ASCII platforms natively use the
+Unicode code points, this function returns its input on them. On EBCDIC
+platforms it converts from EBCDIC to Unicode.
+
+A meaningless value will currently be returned if the input is not an unsigned
+integer.
+
+Since Perl v5.22.0, calls to this function are optimized out on ASCII
+platforms, so there is no performance hit in using it there.
+
+=item * C<$native = utf8::unicode_to_native($code_point)>
+
+(Since Perl v5.8.0)
+This is the inverse of C<utf8::native_to_unicode()>, converting the other
+direction. Again, on ASCII platforms, this returns its input, but on EBCDIC
+platforms it will find the native platform code point, given any Unicode one.
+
+A meaningless value will currently be returned if the input is not an unsigned
+integer.
+
+Since Perl v5.22.0, calls to this function are optimized out on ASCII
+platforms, so there is no performance hit in using it there.
+
+=item * C<$flag = utf8::is_utf8($string)>
+
+(Since Perl 5.8.1) Test whether I<$string> is marked internally as encoded in
+UTF-8. Functionally the same as C<Encode::is_utf8($string)>.
+
+Typically only necessary for debugging and testing, if you need to
+dump the internals of an SV, L<Devel::Peek's|Devel::Peek> Dump()
+provides more detail in a compact form.
+
+If you still think you need this outside of debugging, testing or
+dealing with filenames, you should probably read L<perlunitut> and
+L<perlunifaq/What is "the UTF8 flag"?>.
+
+Don't use this flag as a marker to distinguish character and binary
+data: that should be decided for each variable when you write your
+code.
+
+To force unicode semantics in code portable to perl 5.8 and 5.10, call
+C<utf8::upgrade($string)> unconditionally.
+
+=item * C<$flag = utf8::valid($string)>
+
+[INTERNAL] Test whether I<$string> is in a consistent state regarding
+UTF-8. Will return true if it is well-formed Perl extended UTF-8 and has the
+UTF-8 flag
+on B<or> if I<$string> is held as bytes (both these states are 'consistent').
+The main reason for this routine is to allow Perl's test suite to check
+that operations have left strings in a consistent state.