Closed dibenede closed 4 months ago
What's the status of this? Is there a reason it hasn't been merged?
What's the status of this? Is there a reason it hasn't been merged?
This will be going in shortly. I wanted to cut a release beforehand, which is now done. However, that was slow to get out the door due to release infrastructure issues.
Our prior behavior was extremely undefined when confronted with errors, it would read out of bounds, accept overlong encodings, skip over out of range bytes, compose out of range codepoints. The new implementation always detects and handles errors consistently by either throwing or using replacement characters (� aka \uFFFD)
This also adds support for aligning with the proto3 spec to the code generator which requires that parsing fail for proto3 messages with invalid utf8 payloads for string fields. For now, actual failing is disabled via the goog.define jspb.binary.ENFORCE_UTF8 which is set to NEVER. A future change will flip this to DEFAULT.