behaviour change in getDirectoryContents in GHC 7.2?

Ian Lynagh igloo at earth.li
Mon Nov 7 18:57:44 CET 2011


On Mon, Nov 07, 2011 at 05:02:32PM +0000, Simon Marlow wrote:
> 
> Basically, imagine a reversible transformation:
> 
>   encode :: String -> [Word8]
>   decode :: [Word8] -> String
> 
> this transformation is applied in the appropriate direction by the
> IO library to translate filesystem paths into FilePath and vice
> versa.  No information is lost

I think that would be great if it were true, but it isn't:

$ touch `printf '\x80'`
$ touch `printf '\xEE\xBE\x80'`
$ ghc -e 'System.Directory.getDirectoryContents "." >>= print'
["\61312",".","\61312",".."]

Both of those filenames get encoded as \61312 (U+EF80).


Thanks
Ian




More information about the Glasgow-haskell-users mailing list