Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force pack as binary #86

Open
adrianroe opened this issue Dec 3, 2019 · 1 comment
Open

Force pack as binary #86

adrianroe opened this issue Dec 3, 2019 · 1 comment

Comments

@adrianroe
Copy link

adrianroe commented Dec 3, 2019

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!

@iAchilles
Copy link

@adrianroe Hi, did you resolve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants