Re: BOM and principle of least surprise

[email protected] (Erland Sommarskog)
Newsgroups perl.unicode
Organization Erland Sommarskog
Message-ID <[email protected]>
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.


-- 
Erland Sommarskog, Stockholm, [email protected]
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.