[Haskell-cafe] Same compiled program behaving differently when called from ghci and shell

Manlio Perillo manlio_perillo at libero.it
Sun Nov 21 17:56:44 EST 2010


Il 21/11/2010 21:51, Manlio Perillo ha scritto:
> [...]
> There are 3 solutions:
> 1) open the file in binary mode
> 2) set the console codepage to 1252.
> 
>    I do this by changing the "Command Prompt" shortcut destination to:
>      `%SystemRoot%\system32\cmd.exe /k chcp 1252`
> 3) explicitly set the encoding when reading the file in text mode
> 
>    Unfortunately this is now a rather low level and GHC specific
>    operation:
> 
> http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/GHC-IO-Handle.html
> 

Correction: encoding support is in System.IO (base 4.2 package), but it
is not documented in the Haskell 2010 Report.


By the way: what is the rationale why the TextEncoding data does not
contain the encoding name?


Regards   Manlio


More information about the Haskell-Cafe mailing list