#4855: Debug.Trace.trace mangles Unicode strings
-------------------------------+--------------------------------------------
    Reporter:  andersk         |        Owner:                             
        Type:  bug             |       Status:  new                        
    Priority:  normal          |    Milestone:  7.4.1                      
   Component:  libraries/base  |      Version:  7.0.1                      
    Keywords:                  |     Testcase:                             
   Blockedby:                  |   Difficulty:                             
          Os:  Linux           |     Blocking:                             
Architecture:  x86_64 (amd64)  |      Failure:  Incorrect result at runtime
-------------------------------+--------------------------------------------

Comment(by batterseapower):

 This happens because GHC call the C function debugBelch to output a
 "trace" string. This has the advantage that the user of GHC can override
 how "trace" messages are handled by changing the debugMsgFn function
 pointer.

 If we were to simply delete the GHC-specific #ifdef in Debug.Trace we
 would be using "hPtStrLn stderr" instead, so the correct locale encoding
 would be applied and trace would handle unicode properly.

 Another option is to fix #5061, at which point we can make Trace work
 properly by using withCString instead of withCAString.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4855#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to