id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,os,architecture,failure,difficulty,testcase,blockedby,blocking,related
6016,"On Windows, runhaskell hits an error on UTF-8 files with a BOM",vsajip,,"The file

{{{
#!/usr/bin/env runhaskell
main = putStrLn ""Hello, world!""
}}}
works on Windows as expected:

{{{
C:\Temp>runhaskell hello.hs
Hello, world!
}}}
However, if the file is saved as UTF-8 with a BOM (Windows Notepad, for example, sometimes adds this BOM to files), an error occurs:

{{{
C:\Temp>runhaskell hello2.hs

hello2.hs:1:1: parse error on input `#!/'
}}}

I'm using the Haskell Platform 2011.4.0.0.

I believe that runhaskell/runghc should handle the presence of a BOM correctly; some Windows programs insert a BOM unbeknownst to the user.

This behaviour was observed on Windows XP (32-bit) and Windows 7 (32-bit and 64-bit).
",bug,new,normal,7.6.2,Compiler (Parser),7.0.4,,BOM,dagitj@…,Windows,Unknown/Multiple,GHC rejects valid program,Unknown,,,,
