perl-unicode

Re: Encode, my final take for a while

2000-09-16 14:39:59
        chars_to_utf8(STRING)

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

No assumptions are made on the encoding of the chars.  If you want to
assume that the chars are Unicode and to trap illegal Unicode
characters, you must use C<from_to('Unicode', ...)>.

OK, I can understand why the second paragraph is included here.

        chars_to_utf8(STRING, FROM [, CHECK])

The chars in STRING encoded in FROM are recoded in-place into UTF-8.
Returns the new size of STRING, or C<undef> if there's a failure.

No assumptions are made on the encoding of the chars.  If you want to
assume that the chars are Unicode and to trap illegal Unicode
characters, you must use C<from_to('Unicode', ...)>.

I do not understand the last paragraph in this section.  Isn't it
contradicted by the first paragraph?  The STRING is assumed to have
the encoding that is specified as FROM, right?

-- 
Joe(_dot_)Smith(_at_)inwap(_dot_)com    See http://www.inwap.com/ for details

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