-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix wrong behavior in marshalling invalid UTF-8 byte with EscapeHTML=false #664
base: master
Are you sure you want to change the base?
Fix wrong behavior in marshalling invalid UTF-8 byte with EscapeHTML=false #664
Conversation
split it into two functions, duplicate the code is ok |
88045f2
to
ca479af
Compare
done |
this will affect all users of writeStringSlowPath. do not want to make such a impactful change. |
@taowen This is the same with https://go.dev/src/encoding/json/encode.go#L1029. The code changes essentially restrict contents to be UTF-8. According to golang/go#36686 (comment), I think the users should have accepted this behavior. If they opt for another encodings, they should follow JSON convention by doing transformation in advance. |
they can opt to use the standard library |
@taowen I think jsoniter is created to be one of the better alternatives of official JSON pkg. Should you be considering this feature to be added in another ways such as having |
you may add my wechat "nctaowen" |
See #663