develooper Front page | perl.perl5.porters | Postings from February 2008

Re: use encoding 'utf8' bug for Latin-1 range

Thread Previous | Thread Next
From:
Juerd Waalboer
Date:
February 27, 2008 03:05
Subject:
Re: use encoding 'utf8' bug for Latin-1 range
Message ID:
20080227110125.GX13615@c4.convolution.nl
Juerd Waalboer skribis 2008-02-27 11:57 (+0100):
> > Better to just tell people to use editors that ensure the correct BOM
> > is prepended to the file.
> Not all editors even support this, and it's far from common practice in
> the *nix world, whether we like that or not.

Also, it is not compatible with shebangs:

juerd@lanova:~$ perl -C2 -e'print "\x{feff}#!/usr/bin/perl\ndie\n"' > bom.pl; chmod +x bom.pl; ./bom.pl 2>&1 | hexdump -C
00000000  2e 2f 62 6f 6d 2e 70 6c  3a 20 6c 69 6e 65 20 31  |./bom.pl: line 1|
00000010  3a 20 ef bb bf 23 21 2f  75 73 72 2f 62 69 6e 2f  |: ...#!/usr/bin/|
00000020  70 65 72 6c 3a 20 4e 6f  20 73 75 63 68 20 66 69  |perl: No such fi|
00000030  6c 65 20 6f 72 20 64 69  72 65 63 74 6f 72 79 0a  |le or directory.|
00000040  2e 2f 62 6f 6d 2e 70 6c  3a 20 6c 69 6e 65 20 32  |./bom.pl: line 2|
00000050  3a 20 64 69 65 3a 20 63  6f 6d 6d 61 6e 64 20 6e  |: die: command n|
00000060  6f 74 20 66 6f 75 6e 64  0a                       |ot found.|
00000069
-- 
Met vriendelijke groet,  Kind regards,  Korajn salutojn,

  Juerd Waalboer:  Perl hacker  <#####@juerd.nl>  <http://juerd.nl/sig>
  Convolution:     ICT solutions and consultancy <sales@convolution.nl>

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About