[Haskell-cafe] Filename encoding error (was: Perform a research a la Unix 'find')

Alexey Khudyakov alexey.skladnoy at gmail.com
Sun Aug 22 13:42:07 EDT 2010

On 22.08.2010 21:23, Yves Parès wrote:
> In fact the encoding problem is more general.
> When I simply do 'readFile "bar/fooé"', then I'm told:
> *** Exception: bar/fooé: openFile: does not exist (No such file or
> directory)
> How am I supposed to read files whose names contains non-ASCII characters?
> (I use GHC 6.12.3 under Ubuntu 10.04 32bits)
Unicode handling in GHC always was a problem. There are corresponding 
tickets in bug tracker [1,2]

You have to manually encode/decode strings to/from UTF8 which obviously 
works only for UTF8 locales.

[1] http://hackage.haskell.org/trac/ghc/ticket/3307
[2] http://hackage.haskell.org/trac/ghc/ticket/3309

More information about the Haskell-Cafe mailing list