Skip to content

fix: emit uint8_t as an integer#1459

Merged
SGSSGene merged 2 commits into
jbeder:masterfrom
hydraxman:fix/emit-eight-bit-integers
Jul 11, 2026
Merged

fix: emit uint8_t as an integer#1459
SGSSGene merged 2 commits into
jbeder:masterfrom
hydraxman:fix/emit-eight-bit-integers

Conversation

@hydraxman

@hydraxman hydraxman commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Emit uint8_t/unsigned char through the integral emitter path instead of treating the value as a character.
  • Keep the existing plain char behavior unchanged and add a regression test for numeric output.

Reproduction

  • Before: ./build/test/yaml-cpp-tests --gtest_filter=EmitterTest.UnsignedEightBitInteger → expected - 16, got - "\\x10".
  • After: the same command passes and emits - 16.

Tests

  • ./build/test/yaml-cpp-tests --gtest_filter=EmitterTest.UnsignedEightBitInteger
  • ./build/test/yaml-cpp-tests (1027 tests passed; 8 disabled)

Fixes #1245

@hydraxman hydraxman changed the title Emit uint8_t as an integer fix: emit uint8_t as an integer Jul 10, 2026

@SGSSGene SGSSGene left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR! Looks great!

@SGSSGene
SGSSGene merged commit 3caebe2 into jbeder:master Jul 11, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uint8_t not emit as an integer using YAML::Emitter

3 participants