Ticket #533 (closed defect: fixed)

Opened 4 years ago

Last modified 17 months ago

Cabal file in UTF-8 format can not be handled by Cabal

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Cabal library Version: 1.6.0.2
Severity: normal Keywords: UTF-8
Cc: Difficulty: very easy (<1 hour)
GHC Version: 6.10.1 Platform: Windows

Description

According to  http://www.haskell.org/ghc/docs/latest/html/Cabal/authors.html , a .cabal file should be a Unicode UTF-8 text file; when I change the file to UTF-8 with notepad, Cabal can not handle it:

runhaskell Setup configure

Setup: xyz.cabal:1: unrecognised field or section: "\65279Name: xyz"

Changing this file back to ANSI solves the problem.

Change History

Changed 4 years ago by ross

'\65279' = '\xFEFF' = ZERO WIDTH NO-BREAK SPACE = BYTE ORDER MARK, so it seems notepad inserts a UTF-encoded BOM at the start of the file. Cabal needs to ignore BOMs. (They're classified as format characters, not spaces, in Unicode.)

Changed 4 years ago by duncan

  • difficulty changed from unknown to very easy (<1 hour)

Should be easy to drop a BOM at the beginning of the input.

Changed 4 years ago by duncan

  • status changed from new to closed
  • resolution set to fixed
Sun May 31 23:50:08 BST 2009  Duncan Coutts <duncan@haskell.org>   
  * Ignore a byte order mark (BOM) when reading UTF8 text files
  Yes of course UTF8 text files should not use the BOM but
  notepad.exe does anyway. Fixes ticket #533.

Changed 17 months ago by elga

Note: See TracTickets for help on using tickets.