[erlang-questions] file:read_file an UTF-8 encoded file

Camille Troillard lists@REDACTED
Thu Jun 26 17:58:44 CEST 2014


Hi list,

This is a simple question, yet I haven’t found the right answer.
Using Erlang/OTP 16B03-2:

I read a file using file:read_file(“my_utf8_file.txt”).

The result binary contains the 3 BOM bytes. I was not expecting that. Since this is such a high-level call, isn’t file:read_file/1 supposed to get rid of the byte order mark?

So, how do you professional Erlang users read the contents of a UTF-8 encoded file on Erlang 16B03?


All the bast,
Cam




More information about the erlang-questions mailing list