[erlang-questions] unexpected result of term_to_binary
Mon Jan 21 20:53:37 CET 2013
This make sense to me!
term_to_binary/1 returns a binary data object which is the result of encoding Term according to the Erlang external term format. See http://erlang.org/doc/apps/erts/erl_ext_dist.html
Use list_to_binary or unicode:character_to_binary depends on your use-case.
On Jan 21, 2013, at 9:38 PM, Steve Davis <> wrote:
> The following appears to encode lists of integers as strings (?!?):
> Eshell V5.9.3 (abort with ^G)
> 1> term_to_binary([1,2,3,4]).
> Is there a reason for this that I'm missing?
> erlang-questions mailing list
More information about the erlang-questions