It looks like broken file – some problems can be enforced by BOM http://en.wikipedia.org/wiki/Byte_order_mark or ending symbol “^z”. Look on file in some hexeditor and check start and check end of file. I had a similar problems, when I used a files created on other operation system.
1
solved Cannot create plpgsql function using psql -f filename option