Ticket #286 (closed defect: fixed)
LANG=C 'cabal haddock' fails
|Reported by:||slyfox||Owned by:|
Cabal-126.96.36.199 / 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