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

Enforce UTF-8 encoding #225

Open
louiscb opened this issue Aug 26, 2024 · 0 comments
Open

Enforce UTF-8 encoding #225

louiscb opened this issue Aug 26, 2024 · 0 comments

Comments

@louiscb
Copy link

louiscb commented Aug 26, 2024

Is it possible to enforce UTF-8 encoding on the input? E.g for Jason when passing in a non UTF-8 character such as <<202>> we get an error whilst Poison gives us useless output:

iex(15)> Poison.encode!(%{foo: <<202>>})
<<123, 34, 97, 100, 109, 34, 58, 34, 202, 34, 125>>
iex(16)> Jason.encode!(%{foo: <<202>>})
** (Jason.EncodeError) invalid byte 0xCA in <<202>>
    (jason 1.5.0-alpha.2) lib/jason.ex:164: Jason.encode!/2
    iex:16: (file)
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

1 participant