json-iterator/go

Wrong behavior in marshalling invalid UTF-8 byte with EscapeHTML=false

kz-sher opened this issue · 0 comments

Background:

  • When EscapeHTML=true, marshalling invalid UTF-8 byte will yield \ufffd, which is correct.
  • When EscapeHTML=false, marshalling invalid UTF-8 byte will keep the original byte remaining the same, which is different from encoding/json.

Findings:

Sample: