[GHC] #5257: Calling fail on a UTF-8 encoded string (in file) causes garbage to be printed

GHC cvs-ghc at haskell.org
Wed Jun 15 04:15:10 CEST 2011


#5257: Calling fail on a UTF-8 encoded string (in file) causes garbage to be
printed
-----------------------------------------+----------------------------------
    Reporter:  anthony.de.almeida.lopes  |       Owner:                             
        Type:  bug                       |      Status:  new                        
    Priority:  normal                    |   Component:  Runtime System             
     Version:  7.0.2                     |    Keywords:                             
    Testcase:                            |   Blockedby:                             
          Os:  Linux                     |    Blocking:                             
Architecture:  x86_64 (amd64)            |     Failure:  Incorrect result at runtime
-----------------------------------------+----------------------------------
 For example,

 guerrilla at delta:/tmp/foo$ cat Test.hs
 module Main where

 main :: IO ()
 main =
     do
         putStrLn "μ"
         fail "μ"
 guerrilla at delta:/tmp/foo$ ./Test
 μ
 Test: user error (�)
 guerrilla at delta:/tmp/foo$ ./Test 2>&1 | xxd
 0000000: cebc 0a54 6573 743a 2075 7365 7220 6572  ...Test: user er
 0000010: 726f 7220 28bc 290a                      ror (.).


 Using either encodeString or writing it in escaped hexidecimal does work.

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



More information about the Glasgow-haskell-bugs mailing list