> I said the principle of least surprise, because having read Perluniintro
> my impression was that I should really have to care in which format the
> string was in.

You should not need to care *once* the data has been read into Perl.

Before that, in the input phase, Perl needs your help.

If you have a stream of bytes Perl cannot start blindly guessing
what data it might be.  Either you have to use the PerlIO :layers,
the -C option or its environment counterpart PERL_UNICODE, or use
modules like Encode::Guess.  If from a BOM Perl should guess that
input is in UTF-16, that would make it impossible to read the same
file in as binary.  (Perl does recognize BOMs in Perl scripts, since
it has to kind of its known format...)

> I was proven wrong fairly directly. Certainly, if the
> idea is that Perl is going to continue to ignore BOM, this needs a mention
> in Perluniintro.

Reply via email to