[GHC] #9987: GHC refuses to compile a file that starts with a Byte Order Mark (BOM)

GHC ghc-devs at haskell.org
Fri Jan 16 15:54:56 UTC 2015


#9987: GHC refuses to compile a file that starts with a Byte Order Mark (BOM)
-------------------------------------+-------------------------------------
        Reporter:  Henk-Jan          |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  low               |               Milestone:
       Component:  Compiler          |                 Version:  7.10.1-rc1
      Resolution:                    |                Keywords:
Operating System:  Windows           |            Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by hvr):

 Currently, GHC's lexer assumes its input to be ASCII or UTF8 (for which a
 BOM is rather pointless -- as an UTF8 stream doesn't allow for different
 byteorders).

 The CP1252 (same with ISO-8859-1 btw) encoding, however, is only
 compatible for the lowest 128 code-points.

 I believe the usual recommendation is to use Notepad++ which allows to
 write UTF8 w/o that gratuitous BOM.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9987#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list