Skip to content

Escape non-printable characters in forced scalar styles - #1509

Open
harshkumawat5 wants to merge 1 commit into
jbeder:masterfrom
harshkumawat5:fix-nonprintable-forced-scalar-styles
Open

harshkumawat5 wants to merge 1 commit into
jbeder:masterfrom
harshkumawat5:fix-nonprintable-forced-scalar-styles

Conversation

@harshkumawat5

Copy link
Copy Markdown

Summary

  • Route forced single-quoted and literal scalars containing non-printable bytes or a UTF-8 BOM through the existing escaped double-quoted style.
  • Add round-trip regression coverage for NUL, U+0001, and BOM values in both forced styles.

Root cause

The forced-style validators did not reject non-printable input, so the emitter wrote bytes that those YAML scalar styles cannot represent safely.

Testing

  • All four new regression cases failed before the fix and pass with it.
  • Full CTest suite passes: 3/3 test targets (1,072 unit tests; 8 disabled).
  • Formatting and whitespace checks pass. The strict C++11 build succeeds; pre-existing header shadow warnings and a duplicate-library linker warning remain.

Not included

No broader emitter refactoring.

@SGSSGene SGSSGene added the AI label Oct 11, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants