[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 20:42:29 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:  closed        
  Priority:  normal                       |      Milestone:  7.2.1         
 Component:  Runtime System               |        Version:  7.0.2         
Resolution:  fixed                        |       Keywords:                
  Testcase:                               |      Blockedby:                
Difficulty:                               |             Os:  Linux         
  Blocking:                               |   Architecture:  x86_64 (amd64)
   Failure:  Incorrect result at runtime  |  
------------------------------------------+---------------------------------

Comment(by batterseapower):

 I'm pretty sure your workaround will start to fail for non-ASCII strings.
 The UTF-8 encoded bytes that encodeString injects back into Chars will
 contain some bytes > 127 and so will be subject to another round of UTF-8
 encoding when GHC encodes the String for the console.

 ASCII strings should work fine either way.

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



More information about the Glasgow-haskell-bugs mailing list