Opened 23 months ago

Last modified 5 weeks ago

#10542 new bug

Incorrect Unicode input on Windows Console

Reported by: ptroev Owned by:
Priority: normal Milestone: 8.4.1
Component: Compiler Version: 7.8.3
Keywords: windows stdin utf-8 cmd chcp 65001 getLine Cc:
Operating System: Windows Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Test Case:
Blocked By: Blocking:
Related Tickets: #11394, #4471 Differential Rev(s):
Wiki Page:

Description

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

Change History (2)

comment:1 Changed 16 months ago by bgamari

comment:2 Changed 5 weeks ago by Phyx-

Milestone: 8.4.1
Priority: highnormal

I don't think anything is going to happen here until the new I/O manager is ready. So demoting priority.

Note: See TracTickets for help on using tickets.