-----Ursprüngliche Nachricht-----
Von: Dupont Corentin <[email protected]>
Gesendet: 24.03.2010 11:01:32
An: haskell <[email protected]>
Betreff: [Haskell-cafe] accents

>Hello,
>i have a list of french words with accents.
>How could i handle them?
>If i load them with ghci i get:
>
>> a <- readFile "list.txt"
>> head $ lines a
>"abn\233gation"
>
>putStrLn displays a strange character for the "é".
>
>Cheers,
>Corentin

Encoding problem. Either you want System.IO.UTF8.putStrLn (perhaps also 
readFile), or your file is encoded in latin1 or something and ghci tries to 
output it as UTF8-encoded.
The secure way would be to iconv the file to utf-8 and use the System.IO.UTF8 
I/O-functions.
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to