Thank you Daniel and Ivan, with firefox i finded out that my text file was encoded in WINDOWS-1252.
So a commande line such as: iconv -f WINDOWS-1252 -t ISO-8859-1 liste.txt > liste2.txt did the trick. Alternatively, i modified my code with: myReadFile a = do h <- openFile a ReadMode te <- mkTextEncoding "CP1252" hSetEncoding h te hGetContents h Corentin On 5/7/10, Daniel Fischer <daniel.is.fisc...@web.de> wrote: > On Friday 07 May 2010 17:05:08 you wrote: >> I don't know the encoding of my file, how to deduce it? > > What happens if you open it in a text editor? > When it looks right, can you find out from the editor what encoding it > used? > > You could try opening the file in Firefox (or some other browser), go to > View -> Character Encoding > and see what it thinks it is (click Auto-Detect if you have selected some > default encoding) if it looks right. If it looks garbled, try selecting > different encodings to see if one looks right. > > You could send me [a part of] the file and I could try and find something > out (play a little with iconv). > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe