Skip to content

Commit

Permalink
Merge pull request #125 from pali/master
Browse files Browse the repository at this point in the history
Remove misleading documentation about UTF8 flag
  • Loading branch information
dankogai authored Dec 30, 2017
2 parents 3376708 + 77b6875 commit d470ca6
Showing 1 changed file with 0 additions and 27 deletions.
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

0 comments on commit d470ca6

Please sign in to comment.