#4471: Incorrect Unicode output on Windows Console -------------------------+-------------------------------------------------- Reporter: sankeld | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.2.1 Component: Compiler | Version: 6.12.3 Keywords: | Testcase: Blockedby: | Difficulty: Os: Windows | Blocking: Architecture: x86 | Failure: Incorrect result at runtime -------------------------+--------------------------------------------------
Comment(by sankeld): Replying to [comment:6 simonmar]: > Replying to [comment:5 sankeld]: > > > `_setmode` then is a solution only when the console is set to the Unicode code page. This seems like an adequate solution for now, no? > > > > Here is the link for the _setmode documentation: > > > > http://msdn.microsoft.com/en-us/library/tw4k6df8.aspx > > I don't like to apply a fix without fully understanding what the problem is and why the fix works, and this is all very mysterious to me right now. Why doesn't it work to send UTF-8 to stdout if the current code page is set to UTF-8? I understand your hesitation. I carefully read through the documentation linked there and on the blog post I mentioned. The only thing Microsoft is putting out right now is the "how" and not the "why" unfortunately. I don't have high hopes we'll be able to get beyond speculation as to why the default console mode produces unexpected and unpredictable unicode console output. One thing we can note is that the mention of _O_U16TEXT, _O_U8TEXT, and _O_WTEXT in the _setmode documentation is a recent addition (vs 2010), although they worked prior. This may be an indicator that Microsoft is "blessing" this workaround for the console. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4471#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs