
14 Sep
2011
14 Sep
'11
8:50 a.m.
Hi All. I'm using the function hGetContents in order to read some text file. If one or more of these text file have a wrong UTF encoding, I get the error: hGetContents: invalid argument (Illegal byte sequence) My workaround is to open the wrong encoded file in emacs and create a copy of this file (cut and paste in a new buffer). After this operation the new file has a correct UTF encoding and hGetContents doesn't complain any more. Is there a better way to read (without complaining) such wrong file without an external action (emacs)? Thanks in advance for any answer. Luca.