Incorrect Unicode input on Windows Console
To reproduce:
- start a windows console
- change the console's font to a ttf unicode font, like "Lucida Console".
- type "chcp 65001" to set it to the UTF-8 code page.
- start ghci (same error appears when running compiled executable)
- \> import System.IO (or GHC.IO.Handle)
- \> enc \<- mkTextEncoding "UTF8"
- \> hSetEncoding stdin enc
- \> getLine
- \> Фывфыв (or any international unicode sequence)
- \*\* Exception: \<stdin\>: hGetLine: end of file
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 7.8.3 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | high |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | #4471 |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Incorrect Unicode input on Windows Console","status":"New","operating_system":"","component":"Compiler","related":[4471],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.3","keywords":["65001","chcp","cmd","getLine","stdin","utf-8","windows"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"To reproduce:\r\n- start a windows console\r\n- change the console's font to a ttf unicode font, like \"Lucida Console\".\r\n- type \"chcp 65001\" to set it to the UTF-8 code page.\r\n- start ghci (same error appears when running compiled executable)\r\n- > import System.IO (or GHC.IO.Handle)\r\n- > enc <- mkTextEncoding \"UTF8\"\r\n- > hSetEncoding stdin enc\r\n- > getLine\r\n- > Фывфыв (or any international unicode sequence)\r\n*** Exception: <stdin>: hGetLine: end of file\r\n","type_of_failure":"OtherFailure","blocking":[]} -->
issue