Ticket #286 (closed defect: fixed)

Opened 10 months ago

Last modified 9 months ago

LANG=C 'cabal haddock' fails

Reported by: slyfox Owned by:
Priority: minor Milestone:
Version: 2.13.2.1 Keywords:
Cc:

Description

Cabal-1.19.0.2 / ghc-7.8.1-rc2 and older ones.

Long-standing problem of handing UTF-8 data in description

tasty-golden-2.2.1 $ LANG=C cabal haddock -v3 .... creating dist/doc creating dist/doc/html creating dist/doc/html/tasty-golden cabal: dist/doc/html/tasty-golden/haddock-prolog3034.txt: invalid argument

Today on #ghc:

(18:57:18) slyfoxw_: long ago dcoutts said .cabal files were interpreted as user's local locale. thus it allowed various non-UTF-8 there. don't know what policy for .cabal files is now. would be nice to at least issue a warning about non-ASCII (18:57:43) dcoutts: slyfoxw_: they're now always interpreted as utf8 ... (18:59:32) dcoutts: slyfoxw_, Fuuzetsu: it's possible that the prologe file that cabal makes for haddock gets written in local encoding ... (19:00:29) dcoutts: <...> Cabal has interpreted .cabal files as UTF8 for ages (19:00:35) dcoutts: years ... (19:02:48) dcoutts: Fuuzetsu: iirc, [haddock] just uses readFile, which means it's local encoding ... (19:04:08) dcoutts: Fuuzetsu: so the fix would be to always read the prolog file as utf8 (can just use hSetEncoding), and then we can patch Cabal to write it as utf8 for newer versions of haddock

Change History

Changed 10 months ago by slyfox

Sorry for messed-up markup.

Cabal's issue is here: https://github.com/haskell/cabal/issues/1721

Changed 9 months ago by Fūzetsu

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.