[GHC] #13486: inconsistency in handling the BOM Byte-order-mark in reading and putStrLn

GHC ghc-devs at haskell.org
Wed Apr 5 08:59:35 UTC 2017


#13486: inconsistency in handling the BOM Byte-order-mark in reading and putStrLn
-------------------------------------+-------------------------------------
        Reporter:  andrewufrank      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by andrewufrank):

 i do not see a systematically correct solution (given that BOM is not a
 systematically correct feature ..). therefore warnings in the different
 haddock comments for

 putStrLn - invisible characters (e.g. BOM) may not be shown (use "putStrLn
 . show" to make them visible)

 parsec (and others): consider invisible characters (e.g. a BOM mark at the
 start of the file) and use
     optional (char '\65279')  -- to remove BOM if present

 the problem is not BOM in particular, but the existence of completely
 invisible characters in UTF8.

 alternatively, consider a readFile alternate which does not read BOM at
 the beginning.

 none of these solutions are really attractive!
 andrew

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


More information about the ghc-tickets mailing list