The problem is that Prelude.getLine uses current locale to load characters:
for example if you have utf8 locale, then everything works out of the box:
> $ runhaskell 1.hs
> résumé 履歴書 резюме
> résumé 履歴書 резюме
But if you change locale you'll have error:
> LANG="C" runhaskell 1.hs
> résumé 履歴書 резюме
> 1.hs: <stdin>: hGetLine: invalid argument (invalid byte sequence)
To force haskell use UTF8 you can load string as byte sequence and convert it to UTF-8
charecters for example by
import qualified Data.ByteString as S
import qualified Data.Text.Encoding as T
main = do
x <- fmap T.decodeUtf8 S.getLine
now code will work even with different locale, and you'll load UTF8 from shell
independenty of user input's there
--
Alexander