[erlang-bugs] Misleading docs or implementation of file:read/2 and friends
Anthony Ramine
n.oxyde@REDACTED
Thu Mar 12 23:33:25 CET 2015
Le 3 mars 2015 à 17:15, Dan Gudmundsson <dgud@REDACTED> a écrit :
> I took at file:read_line issue, and thought about it :-)
>
> IMHO it should behave as file:read/2 does and how it is documented.
> i.e. return {error, {no_translation, unicode, latin1}} for both binary and list mode
> when encoding is set to unicode and reading non latin1 code points.
> (Which is confusing but that is how it is intended/documented,
> use io module for translating non latin1 codepoints).
The problem is that file uses io in read/2 itself, calling io:request/2,
which ultimately invariably converts the response to Unicode.
More information about the erlang-bugs
mailing list