#6016: On Windows, runhaskell hits an error on UTF-8 files with a BOM
---------------------------------------+------------------------------------
Reporter: vsajip | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Parser)
Version: 7.0.4 | Keywords: BOM
Os: Windows | Architecture: Unknown/Multiple
Failure: GHC rejects valid program | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------------+------------------------------------
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).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6016>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs