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

Bulat Ziganshin bulat.ziganshin at gmail.com
Tue Jun 16 07:42:31 EDT 2009

Hello Simon,

Tuesday, June 16, 2009, 3:30:31 PM, you wrote:

> Care to submit a patch to put this in System.Directory, or better still
> put the relevant functionality in System.Win32 and use it in 
> System.Directory?

Simon, it will somewhat broke openFile. let's see. there are 3 types
of filenames -

1) english (latin-1) only
2) including local (ansi code page) chars
3) including any other unicode chars

now getDirectoryContents return ACP (ansi code page) names so openFile
works for files 1) and 2)

with such change getDirectoryContents will return correct unicode
names, so openFile will work only with names in first group

the right way is to fix ALL string-related calls in System.IO,
System.Posix.Internals, System.Environment

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list