Hsc2Hs/hGetContents encodings error

Simon Marlow marlowsd at gmail.com
Mon Nov 23 10:27:54 EST 2009


On 23/11/09 07:02, Daniel Schüssler wrote:
> P.S.:
>
> Locale is UTF-8, I guess hGetContents gets the default encoding from the
> locale now?

Yes it does.  It just occurred to me that hsc2hs should probably be 
setting the encoding to UTF8 explicitly before reading Haskell source files.

Cheers,
	Simon


>
>
> On Monday 23 November 2009 07:53:55 Daniel Schüssler wrote:
>> Hi,
>>
>> I don't think this is the same problem as the one mentioned by Alex
>> (installing `network' works for me):
>>
>> {----------------------------------------------
>> $ cabal install X11
>>
>> Resolving dependencies...
>> Configuring X11-1.4.6.1...
>> configure: WARNING: unrecognized options: --with-compiler
>> checking for gcc... gcc
>> checking for C compiler default output file name... a.out
>>
>> [... configure stuff omitted...]
>>
>> checking for X11/cursorfont.h... yes
>> configure: creating ./config.status
>> config.status: creating config.mk
>> config.status: creating X11.buildinfo
>> config.status: creating include/HsX11Config.h
>> config.status: creating include/X11_extras_config.h
>> configure: WARNING: unrecognized options: --with-compiler
>> Preprocessing library X11-1.4.6.1...
>> hsc2hs: Graphics/X11/Xlib/Extras.hsc: hGetContents: invalid argument
>>   (Invalid or incomplete multibyte or wide character)
>> cabal: Error: some packages failed to install:
>> X11-1.4.6.1 failed during the building phase. The exception was:
>> ExitFailure 1
>> ----------------------------------------------}
>>
>>
>> Converting the offending file (Extras.hsc) to UTF-8 manually solves it:
>>
>>
>> {----------------------------------------------
>>
>> $ file Extras.hsc
>> Extras.hsc: ISO-8859 English text
>>
>> $<Extras.hsc iconv -f ISO-8859-1 -t UTF8>temp
>> $ mv temp Extras.hsc
>> $ cd ../../..
>> $ cabal install
>> [OK]
>>
>> ----------------------------------------------}
>>
>>
>>
>> Greetings,
>> Daniel
>>
>> On Sunday 22 November 2009 18:53:07 Ian Lynagh wrote:
>>> Hi all,
>>>
>>> We are pleased to announce the second release candidate for GHC 6.12.1:
>>>
>>>      http://www.haskell.org/ghc/dist/6.12.1-rc2/
>>>
>>> As well as the source tarball:
>>>      ghc-6.12.0.20091121-src.tar.bz2
>>> there are installers for Windows (i386) and OS X (i386), and binary
>>> distributions for x86_64/Linux and i386/Linux. For the Linux binary
>>> distributions, the "linux-n" tarballs are recommended over the "linux"
>>> tarballs.
>>>
>>>
>>> Please test as much as possible; bugs are much cheaper if we find them
>>> before the release!
>>>
>>>
>>> Thanks
>>> Ian, on behalf of the GHC team
>>>
>>> _______________________________________________
>>> Glasgow-haskell-users mailing list
>>> Glasgow-haskell-users at haskell.org
>>> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>>
>> _______________________________________________
>> Glasgow-haskell-users mailing list
>> Glasgow-haskell-users at haskell.org
>> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



More information about the Glasgow-haskell-users mailing list