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

Camille Troillard lists@REDACTED
Thu Jun 26 18:37:15 CEST 2014


On 26 Jun 2014, at 18:23, Loïc Hoguin <essen@REDACTED> wrote:

> file:read_file/1 reads a file as a sequence of bytes. It doesn't know what kind of file it is, or how to interpret it. It's not file:read_text_file/1 or similar, it's just read_file. It's not high level at all, it's just a convenient shortcut.

Thank you Loïc, for this educative answer. But as you know file:open takes an encoding option, so it wouldn’t be totally insane to have the same on file:read_file/1.

So I understand there is no “high level” way of reading an entire text file in Erlang?




More information about the erlang-questions mailing list