The following code prints something like °Ð½Ð´Ð¸Ñ-ÐÑпаниÑ
getDirectoryContents "path/to/directory/that/contains/files/with/nonASCII/names" >>= mapM_ putStrLn
This seems to be a ghc bug and has already been fixed in the repository. But what to do until everyone updates ghc?
The last time I encountered such a problem (this was a few years ago, by the way), I used the utf8-string package to convert strings, but I don’t remember how I did it, and ghc unicode support has changed markedly over the years.
So what is the best (or at least working) way to get the contents of a directory with full Unicode support?
ghc version 7.0.4 locale en_US.UTF-8
Yuras source share