perl-unicode

Re: Encode, take five

2000-09-12 20:11:01
I'm much tempted to go with these.  Yes, it's ISO 8859-1-biased.

=item *

        bytes_to_utf8(STRING)

The bytes in STRING are encoded in-place into UTF-8.  The bytes
are expected to be encoded in US-ASCII or ISO 8859-1 (Latin 1).
Returns the new size of STRING, or C<undef> if there's a failure.

[INTERNAL] Also the UTF-8 flag of STRING is turned on.

=item *

        utf8_to_bytes(STRING [, CHECK])

The UTF-8 in STRING is decoded in-place into bytes.  Returns the new
size of STRING, or C<undef> if there's a failure.

What if there are characters > 255?  What if the UTF-8 in STRING is
malformed?  See L</"Handling Malformed Data">.

[INTERNAL] The UTF-8 flag of STRING is not checked.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

<Prev in Thread] Current Thread [Next in Thread>