-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Certain characters break the string in the marshal method.
Here's an example:
Actual result:
─ iex -S mix
Erlang/OTP 22 [erts-10.6.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Compiling 3 files (.ex)
Interactive Elixir (1.9.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> covid_19 = %{pandemic: "{sucks}"}
%{pandemic: "{sucks}"}
iex(2)> ExNdjson.marshal!([covid_19])
"{\"pandemic\":{sucks}}\n"
Expected result:
─ iex -S mix
Erlang/OTP 22 [erts-10.6.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Interactive Elixir (1.9.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> covid_19 = %{pandemic: "{sucks}"}
%{pandemic: "{sucks}"}
iex(2)> ExNdjson.marshal!([covid_19])
"{\"pandemic\":\"{sucks}\"}\n"
By simply deleting the cleanup_string function, everything seems to work. What is the objective of this method?
Proof:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

