I noticed the same issue under ubuntu when feeding my program (i.e. on the command line) file names with special characters (my locale is fr_FR.UTF-8).
I discovered I had to use Codec.Binary.String.UTF8.decodeString. I didn't know it was only for Unix.


2011/2/11 Joey Hess <joey@kitenet.net>
I've been trying to deal with how my haskell program handles unicode
filenames. Been dealing with problems like those described here:

http://hackage.haskell.org/trac/ghc/ticket/3307

Or, simply demonstrated by feeding unicode to getLine >>= readFile

My approach currently is to carefully identify any point where
a FilePath is output, and run it through a filePathToString (which
varies by OS), as suggested in the above bug report.

Is there a less tedious and error-prone way? What is the best approach
to use now, assuming that these issues will be dealt with in some way
in Haskell, eventually?

--
see shy jo

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIVAwUBTVWRnckQ2SIlEuPHAQiCZQ//XDhguOgPZsakn1r6AwsvGn9iWRS00KFL
JWvqnhcrbXa2oWIrQLgtiC5AFNO6zVMYn36xmpUbutzBXbg6xiTRMqR8PI9xUihK
Foamq6jhdPRP2wkZ6E5hEwlcrivdPJ6NgXzwoLNFFfmGWyzBW5yp2wdUFyw5yyab
z+xurC0ZDFT+86j8aja3WASyiXPdzzeH38Q3oh0tguPOPfBwdI5QEBRP/bScD9aS
4I/4Yg6duf0/ubcqP/dG6EmNSLx54K8+DEmCPdTrSd6AD1/8PWXddKp3VMPEuyrt
dDgylm5PqIHtM4+wzvKnhFe4e1bEs3VcplFB5AMmKk0Xqe55JzUfneSyjRl5jMJc
7oJK9LFdz9YlVKfruELSVS6LRqgMY75s8877+WWr9/woW3YytVXpnrosTeNnvqY7
5ibLaBxL2h8dscmkje6h/E3rox5/vaUAqyLvbFa8mn1AKwuHwA+6UcXW7FPpTp7+
o44JHOsN2aEJYYvz7EgrxJuAqk3Pdj1R7YD3OxIhgvRZhjldt9FlCTdLp0s+P4pW
unqu+vxgA8MZAoB4DlJ8DadoPxtcEH6hDRSt4u9JKzaAVxo58Do5sM92x5ekOCr0
DMJ9NuzLzdUtfxH2Bw4qF6j81GOW8fuXwZtpIB9YsZzlTGx6uGx1u9Q25vdkR3eO
Y8KGur5CCGs=
=Fyl1
-----END PGP SIGNATURE-----

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe