Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

haskell: output non-ascii characters

I'd like to output non-ascii characters in WinGHCi, but this is what I get:

Prelude> "δ"
"\948"
Prelude> putStr "\948"
*** Exception: <stdout>: hPutChar: invalid argument (character is not in the code page)

I am using WinGHCi 7.0.3 on windows xp. What do I have to do so that WinGHCi prints a nice little delta?

like image 699
Alex Avatar asked Sep 22 '11 07:09

Alex


2 Answers

Works on OSX!

Prelude> putStrLn "\948"
δ

Sounds like this is a windows problem with nothing to do with haskell...

like image 130
pat Avatar answered Sep 28 '22 05:09

pat


This is a WinGHCI bug. Use GHCI (the console, non-GUI version).

UPD: this is apparently not entirely correct (works for me with Greek letters and not e.g. Cyrillic).

like image 28
n. 1.8e9-where's-my-share m. Avatar answered Sep 28 '22 06:09

n. 1.8e9-where's-my-share m.