I would like to read a line from the console containing special characters like ö, ä, ü, μ ... I tried:
do ... ts <- getLine ...
but this does not work for these characters. For example, unicode for ö is \ 246, but if I use getLine to read in ö haskell, read in "\ 195 \ 182" and putStr "\ 195 \ 182" gives me ö, which is not ö. What is the problem? Do I need another function to read these characters?
I am using WinGHCi 7.0.3 for windows xp. I would be glad if someone could help me, because I have not found anything so far.
@ Judah Jacobson:
I tried again before entering any other commands, and got the following:
Prelude> :m +System.IO
Prelude System.IO> hSetEncoding stdin utf8
Prelude System.IO> getLine
ασδφ
"\206\177\207\402\206\180\207\8224"
Prelude System.IO> putStr "\206\177\207\402\206\180\207\8224"
ασδφPrelude System.IO>
I also tried the windows chcp 65001 command, but it didn’t change anything, I already had utf8 in windows.