Reputation: 12516
Windows 8.1 x64 Russian.
I create and fill the %AppData%\ghc\ghci.conf
file:
:! title GHCi (Haskell interpreter)
putStrLn $ replicate 30 '*'
putStrLn "© Андрей Бушман, 2014" -- The sample of some not English chars...
:set prompt "\x03BB: "
This file has the UTF-8 without BOM
encoding. I run ghci
via Cmd.exe
and PowerShell.exe
. I set necessary font and codepage before. But I get unexpected result: incorrect text output. Why I get it?
UPD
I can resave my ghci.conf
file with Windows 1251
encoding and add the :! chcp 1251
at first row:
:! chcp 1251
:! title GHCi (Haskell interpreter)
putStrLn $ replicate 30 '*'
putStrLn "© Андрей Бушман, 2014" -- The sample of not English chars...
:set prompt "\x03BB: "
Now I see the correct result:
But why it doesn't work when I save with UTF-8
or UTF-8 without BOM
encodings and set 65001 codepage?
Also... I get incorrect text in the title when I use the cyrillic chars:
:! chcp 1251
-- Cyrillic in te title:
:! title GHCi (Интерпретатор Haskell)
putStrLn $ replicate 30 '*'
putStrLn "© Андрей Бушман, 2014 (\"авторские права\" на данное сообщение ;) )"
:set prompt "\x03BB: "
How can I fix it?
Upvotes: 2
Views: 308
Reputation: 472
This is probably related to the following question: Unicode console I/O in Haskell on Windows
Btw, setting the font in the console will not affect what codepage is used.
Upvotes: 1