[X-Unix] BBEdit Unicode UTF-8 Encoding Prefix Makes Scripts Fail

Albert Lunde atlunde at panix.com
Fri Jun 30 09:29:34 PDT 2006


On Fri, Jun 30, 2006 at 08:42:34AM -0700, Jerry Krinock wrote:
> I write just enough perl and shell scripts to be dangerous.  Sometimes they
> just "don't work", and I finally discovered why.
> 
> If you save a perl script (or any text file) using BBEdit with Unicode UTF-8
> encoding, it will add three bytes at the beginning
> (0xefbbff), before your shebang.  I guess this identifies the encoding.
> BBEdit does not show these characters.

That's a Byte Order Mark, see:

http://www.unicode.org/faq/utf_bom.html#BOM

It's not required with UTF-8 but use of an appropriate BOM is valid with 
any Unicode Encoding. 

BBEdit Save As.. has options under Encoding to save without a BOM.

-- 
    Albert Lunde  albert-lunde at northwestern.edu
                  atlunde at panix.com  (new address for personal mail)
                  albert-lunde at nwu.edu (old address)


More information about the X-Unix mailing list