
24 Mar
2010
24 Mar
'10
10:35 a.m.
-----Ursprüngliche Nachricht-----
Von: Dupont Corentin
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.