patch applied (cabal): First pass at parsing .cabal files as UTF8

Duncan Coutts duncan.coutts at
Sun Feb 24 12:46:35 EST 2008

On Sun, 2008-02-24 at 14:44 +0000, Ross Paterson wrote:
> On Sat, Feb 23, 2008 at 10:49:59AM -0800, Duncan Coutts wrote:
> > Sat Feb 23 10:40:25 PST 2008  Duncan Coutts <duncan at>
> >   * First pass at parsing .cabal files as UTF8
> >   Also print output and error messages etc in UTF8.
> On the input side, wouldn't it be better to do this on the boundary,
> so that String always means a list of Chars, not octets?  That is,
> have a readUTFFile that opens the file in binary mode and applies
> fromUTF to its contents, yielding a real String.

You're right of course. I've added readTextFile and writeTextFile to the
Utils module and checked all other uses of readFile and writeFile.

I've also switched the rawSystemStdout to assume UTF8 output format.

So what about hackage? It now has to assume the Strings in the package
description etc are proper Haskell Unicode Strings and convert to UFT8
output. Distribution.Simple.Utils exports toUTF8 for this purpose.


More information about the cabal-devel mailing list