[Haskell-cafe] Re: Unicode workaround for getDirectoryContents under Windows?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Thu Jun 18 10:18:39 EDT 2009


On Thu, 2009-06-18 at 04:47 +0300, Yitzchak Gale wrote:
> I wrote:
> >> OK, would you like me to reflect this discussion in tickets?
> >> Let's see, so far we have #3300, I don't see anything else.
> >>
> >> Do you want two tickets, one each for WIndows/Unix? Or
> >> four, separating the FilePath and getArgs issues?
> 
> Simon Marlow wrote:
> > One for each issue is usually better, so four.
> 
> OK, they are: #3300, #3307, #3308, #3309.

Could we please make clear in those tickets that they only affect
Windows. I do hope we are only proposing that FilePath be interpreted as
Unicode on Window and OSX. It would break things to decode to Unicode on
Unix systems. On Unix filepaths really are strings of bytes, not an
encoding of Unicode code points. It's true that this is not reflected
accurately in the type FilePath = String.

The FilePath should be an opaque type that allows decoding into a human
readable Unicode String.

I wonder how much code would actually break if FilePath became an opaque
type, eg if we make it an instance of IsString. It only need change in
System.IO and System.FilePath, not in the old H98 modules.

Duncan



More information about the Haskell-Cafe mailing list