#5221: unicode regression
---------------------------------+------------------------------------------
    Reporter:  igloo             |        Owner:  batterseapower
        Type:  bug               |       Status:  new           
    Priority:  high              |    Milestone:  7.2.1         
   Component:  Compiler          |      Version:  7.1           
    Keywords:                    |     Testcase:                
   Blockedby:                    |   Difficulty:                
          Os:  Unknown/Multiple  |     Blocking:                
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown  
---------------------------------+------------------------------------------
 This program now fails:
 {{{
 $ touch `printf "a1\243a"`
 $ ls -b a*
 a1\243a
 $ cat q.hs

 import Data.List
 import System.Directory

 main :: IO ()
 main = do xs <- getDirectoryContents "."
           let ys = filter ("a" `isPrefixOf`) xs
           print ys
           mapM_ removeFile ys

 $ ghc --make q
 $ ./q
 ["a1\61347a"]
 q: a1�a: removeLink: does not exist (No such file or directory)
 $ ls -b a*
 a1\243a
 $
 }}}

 Max says:

 {{{
 This program should work unmodified. The fact that it doesn't
 demonstrates that I need to replace some instances of the
 Foreign.C.*CString functions with their escape-handling counterparts
 (withFilePath and friends). Although I fixed this in some libraries I
 apparently forgot to do so in others.

 Alternatively, I could change the Foreign.C functions to do the Right
 Thing with escape characters. This would strictly be in violation of
 the FFI spec though it would make it vastly more probable that 3rd
 party libraries would work correctly with strings containing
 surrogates.
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5221>
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