+=head1 Handling Malformed Data
+
+If CHECK is not set, C<undef> is returned. If the data is supposed to
+be UTF-8, an optional lexical warning (category utf8) is given. If
+CHECK is true but not a code reference, dies.
+
+It would desirable to have a way to indicate that transform should use
+the encodings "replacement character" - no such mechanism is defined yet.
+
+It is also planned to allow I<CHECK> to be a code reference.
+
+This is not yet implemented as there are design issues with what its
+arguments should be and how it returns its results.
+
+=over 4
+
+=item Scheme 1
+
+Passed remaining fragment of string being processed.
+Modifies it in place to remove bytes/characters it can understand
+and returns a string used to represent them.
+e.g.
+
+ sub fixup {
+ my $ch = substr($_[0],0,1,'');
+ return sprintf("\x{%02X}",ord($ch);
+ }
+
+This scheme is close to how underlying C code for Encode works, but gives
+the fixup routine very little context.
+
+=item Scheme 2
+
+Passed original string, and an index into it of the problem area, and
+output string so far. Appends what it will to output string and
+returns new index into original string. For example:
+
+ sub fixup {
+ # my ($s,$i,$d) = @_;
+ my $ch = substr($_[0],$_[1],1);
+ $_[2] .= sprintf("\x{%02X}",ord($ch);
+ return $_[1]+1;
+ }
+
+This scheme gives maximal control to the fixup routine but is more
+complicated to code, and may need internals of Encode to be tweaked to
+keep original string intact.
+
+=item Other Schemes
+
+Hybrids of above.
+
+Multiple return values rather than in-place modifications.
+
+Index into the string could be C<pos($str)> allowing C<s/\G...//>.
+
+=back
+
+=head2 UTF-8 / utf8
+
+The Unicode consortium defines the UTF-8 standard as a way of encoding
+the entire Unicode repertoire as sequences of octets. This encoding is
+expected to become very widespread. Perl can use this form internally
+to represent strings, so conversions to and from this form are
+particularly efficient (as octets in memory do not have to change,
+just the meta-data that tells Perl how to treat them).
+
+=over 4
+
+=item $bytes = encode_utf8($string);
+
+The characters that comprise string are encoded in Perl's superset of UTF-8
+and the resulting octets returned as a sequence of bytes. All possible
+characters have a UTF-8 representation so this function cannot fail.
+
+=item $string = decode_utf8($bytes [, CHECK]);
+
+The sequence of octets represented by $bytes is decoded from UTF-8
+into a sequence of logical characters. Not all sequences of octets
+form valid UTF-8 encodings, so it is possible for this call to fail.
+For CHECK see L</"Handling Malformed Data">.
+
+=back
+
+=head1 Defining Encodings
+
+To define a new encoding, use:
+
+ use Encode qw(define_alias);
+ define_encoding($object, 'canonicalName' [, alias...]);
+
+I<canonicalName> will be associated with I<$object>. The object
+should provide the interface described in L<Encode::Encoding>
+If more than two arguments are provided then additional
+arguments are taken as aliases for I<$object> as for C<define_alias>.
+