Ticket #5221 (closed bug: worksforme)
unicode regression
| Reported by: | igloo | Owned by: | batterseapower |
|---|---|---|---|
| Priority: | high | Milestone: | 7.2.1 |
| Component: | Compiler | Version: | 7.1 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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.
Change History
Note: See
TracTickets for help on using
tickets.
