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

Jiffy can't handle UTF8 atom #231

Open
lafirest opened this issue Sep 1, 2023 · 0 comments
Open

Jiffy can't handle UTF8 atom #231

lafirest opened this issue Sep 1, 2023 · 0 comments

Comments

@lafirest
Copy link

lafirest commented Sep 1, 2023

When I ran the probability test, I found that the jiffy can't handle UTF-8 atoms, as the below showed

v5.1.1-gab5fd1e5(emqx@127.0.0.1)14> jsone:encode(#{reason => 'ŝatas'}).                     
<<"{\"reason\":\"\\u015datas\"}">>
v5.1.1-gab5fd1e5(emqx@127.0.0.1)15> jsx:encode(#{reason => 'ŝatas'}).  
<<123,34,114,101,97,115,111,110,34,58,34,197,157,97,116,
  97,115,34,125>>
v5.1.1-gab5fd1e5(emqx@127.0.0.1)16> jiffy:encode(#{reason => 'ŝatas'}).
** exception error: {invalid_string,'ŝatas'}
     in function  jiffy:encode/2 (jiffy.erl, line 99)
v5.1.1-gab5fd1e5(emqx@127.0.0.1)17> jsone:encode(#{reason => '你好'}). 
<<"{\"reason\":\"\\u4f60\\u597d\"}">>
v5.1.1-gab5fd1e5(emqx@127.0.0.1)18> jsx:encode(#{reason => '你好'}).   
<<123,34,114,101,97,115,111,110,34,58,34,228,189,160,229,
  165,189,34,125>>
v5.1.1-gab5fd1e5(emqx@127.0.0.1)19> jiffy:encode(#{reason => '你好'}). 
** exception error: {invalid_string,'你好'}
     in function  jiffy:encode/2 (jiffy.erl, line 99)
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