
#8118: <stdout>: commitAndReleaseBuffer: invalid argument (invalid character) -------------------------------------+------------------------------------- Reporter: guest | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: #5666 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Replying to [comment:17 HairyDude]:
This gets correct output:
{{{ import GHC.IO.Encoding import System.Win32.Console
main = do ... setLocaleEncoding utf8 setConsoleOutputCP 65001 ... }}}
''If you're only dealing with files''. If you attempt to read/write from the console, things still break: {{{#!hs import GHC.IO.Encoding import System.Win32.Console main :: IO () main = do setLocaleEncoding utf8 setConsoleOutputCP 65001 putStrLn "→" }}} {{{ *Main> main *** Exception: <stdout>: hPutChar: invalid argument (invalid character) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8118#comment:19 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler