msgpack-erlang
msgpack-erlang copied to clipboard
Force pack as binary
I'm trying to pack the following data structure.
#{<<"Coalesce">> => true,
<<"Name">> => <<"streamAvailable">>,
<<"Payload">> =>
term_to_binary({streamAvailable,{streamId,<<"stream1">>},<<"172.16.169.1">>})
}.
In a perfect world I would use '{pack_str, from_binary}' but it then tries to pack Payload as a string and fails on the 'unicode:characters_to_binary' check. Is there a way to force Payload to be encoded as a binary while allowing the others to remain strings?
Thanks for the efforts on a great library!
@adrianroe Hi, did you resolve this issue?