in reply to Re: running scripts in Mac OS 10.4
in thread running scripts in Mac OS 10.4

That's a Byte-order mark. It looks as if your editor is trying to save your file as UTF-8. If you get rid of those, I think you'll be OK.

Replies are listed 'Best First'.
Re^3: running scripts in Mac OS 10.4
by rogerd (Sexton) on Jun 25, 2008 at 21:04 UTC
    Thank you Kyle... you are right, that was the problem. Maybe I am going out of topic, but can I ask you which encoding do you recommend to use?
      The recommended encoding would probably be ASCII. ;^)

      The problem is not so much the use of utf8 encoding for the script itself (it is possible to put "wide characters" in the script, along with use ut8;). Rather, it is the unnecessary and presumptuous inclusion of the initial byte order mark (BOM), which many people believe should not happen with utf8 encoded files, because byte order is never an issue for utf8 data.

      Anyone knowingly using anything other than ASCII for their source code is a damned fool. If you need non-ASCII data, such as for text that you'll spit out at the user, that should live elsewhere in a resource file. Not only will that do away with problems like the one you're having, it will also mean that things don't break when someone using a different character set edits your code*, and you'll already be half way to supporting multiple languages.

      * any bleating about "everyone should use UTF-8" will be ignored because regardless of whether people should use it the fact is that lots of people don't use it, and you want to keep the "barrier to entry" for them submitting patches that fix your bugs as low as possible.

        Weeeell, everyone should use U... ;-)

        You are almost right when it concerns open source and the here and now (as many OS and script languages are not yet utf8-ready, perl and linux are exceptions AFAIK). But remember that a lot of software is written in other languages without any intention or need for worldwide collaborative development. Why should its programmers jump through loops just to print a message in their native language?

        From a practicability standpoint using utf-8 now might lead to problems. But from the standpoint of non-english-speaking people it is high time that utf8 is in universal use.

        And hopefully those problems lead to faster adoption of utf8 instead of the practical solution. Because otherwise we get the same situation as with IPv4 and IPv6. The intertia of the ones with enough IP-addresses prolong the problems of those with too few.