Fix wrong behavior in marshalling invalid UTF-8 byte with EscapeHTML=false#664
Fix wrong behavior in marshalling invalid UTF-8 byte with EscapeHTML=false#664kz-sher wants to merge 2 commits intojson-iterator:masterfrom
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