Re: BOM and principle of least surprise

[email protected] (Nick Ing-Simmons)
Newsgroups perl.unicode
Message-ID <[email protected]>
Erland Sommarskog <[email protected]> writes:
>Jarkko Hietaniemi ([email protected]) writes:
>> Nick Ing-Simmons wrote:
>>> This thread started as complaint that perl5 can't read a 
>>> script saved as UCS-2/UTF-16 or whatever Windows uses.
>> 
>> Uh, really?  Perl 5.8+ should be able to do that, automatically.
>
>To be able to that, it would have have to understand byte-order marks (which 
>it doesn't). I think there was a suggestion that you could specify an
>option on the command-line to specify the encoding of the script file,
>but I haven't tried. 
> 
>> I thought the issue was about Perl not automatically guessing the
>> UTF-16 encoding of input data.
>
>Both input data and the script. Just because the script has been saved
>in UTF-8, does not mean that literals in the script are taken as UTF-8.

I disagree there. The literals have to be in same encoding as 
the surounding script - anything else is madness.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.