Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove misleading documentation about UTF8 flag #125

Merged
merged 1 commit into from
Dec 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions Encode.pm
Original file line number Diff line number Diff line change
Expand Up @@ -949,38 +949,11 @@ different kinds of strings and string-operations in Perl: one a
byte-oriented mode for when the internal UTF8 flag is off, and the other a
character-oriented mode for when the internal UTF8 flag is on.

Here is how C<Encode> handles the UTF8 flag.

=over 2

=item *

When you I<encode>, the resulting UTF8 flag is always B<off>.

=item *

When you I<decode>, the resulting UTF8 flag is B<on>--I<unless> you can
unambiguously represent data. Here is what we mean by "unambiguously".
After C<$str = decode("foo", $octet)>,

When $octet is... The UTF8 flag in $str is
---------------------------------------------
In ASCII only (or EBCDIC only) OFF
In ISO-8859-1 ON
In any other Encoding ON
---------------------------------------------

As you see, there is one exception: in ASCII. That way you can assume
Goal #1. And with C<Encode>, Goal #2 is assumed but you still have to be
careful in the cases mentioned in the B<CAVEAT> paragraphs above.

This UTF8 flag is not visible in Perl scripts, exactly for the same reason
you cannot (or rather, you I<don't have to>) see whether a scalar contains
a string, an integer, or a floating-point number. But you can still peek
and poke these if you will. See the next section.

=back

=head2 Messing with Perl's Internals

The following API uses parts of Perl's internals in the current
Expand Down