[Haskell-cafe] Unicode pretty-printing

Peter Gromov gromopetr at gmail.com
Sun Aug 29 07:24:02 EDT 2010


Yes, it's GHC 6.12.3. Character escapes are the least I want to see.
As for the locale:

$ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

Unfortunately, I'm completely lame with locales and googling doesn't
help very much to change "C" to something like UTF-8 (Mac, Snow
Leopard). But the terminal does support UTF-8 anyway, as the output
from my previous message shows (the main function output).

On 29 August 2010 11:49, Ivan Lazar Miljenovic
<ivan.miljenovic at gmail.com> wrote:
> 2010/8/29 Peter Gromov <gromopetr at gmail.com>:
>> Thanks for getting back to me. I was imprecise, by UTF8 characters I
>> mean Unicode. My source files are UTF8-encoded, and Haskell reads them
>> fine, it only has problems outputting them in a readable way. At this
>> point I'm not talking of any I/O besides plain console output.
>
> How are you outputting them?  Unless you use a textual String I/O
> function with GHC 6.12, then by default showing a String will print it
> with escape characters for non-latin characters.
>
>> Prelude> :load utest.hs
>> [1 of 1] Compiling Main             ( utest.hs, interpreted )
>> Ok, modules loaded: Main.
>> *Main> main
>> это тест
>> *Main> runTestTT test1
>> ### Failure:
>> fail
>> expected: *** Exception: <stderr>: hPutChar: invalid argument (Illegal
>> byte sequence)
>
> Hmmm... if you are using GHC 6.12, what's your locale?  I've only seen
> error messages like that when using something with a different
> encoding than your locale.
>
> --
> Ivan Lazar Miljenovic
> Ivan.Miljenovic at gmail.com
> IvanMiljenovic.wordpress.com
>


More information about the Haskell-Cafe mailing list