aaltay opened a new pull request, #4099: URL: https://github.com/apache/avro/pull/4099
## What is the purpose of the change `escape()` in `lang/c++/impl/NodeImpl.cc` emits a raw `0x0c` byte (`s += '\f'`) instead of `\f` (`s += '\\'; s += 'f';`) when serializing schema `doc` strings and string default values, whereas `\b`, `\n`, `\r`, `\t`, `\"`, and `\\` are all escaped as two-character sequences. Any schema containing a form-feed character therefore serializes to invalid JSON (RFC 8259 section 7) in Avro file headers and `toJson()` output. ## Verifying this change This change added tests and can be verified as follows: - Extended `lang/c++/test/SchemaTests.cc` (`schemasToCompact` / `compactSchemas`) with both an escaped `\\f` and a raw `\f` in a record `doc` string, verifying both serialize to `\\f` in the compacted JSON schema (fails before the fix and passes with it). ## Documentation - Does this pull request introduce a new feature? no -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
