Skip to content

fix: fall back from null cmap mappings - #352

Open
nurikk wants to merge 1 commit into
docling-project:mainfrom
nurikk:fix/control-glyph-mapping
Open

nurikk wants to merge 1 commit into
docling-project:mainfrom
nurikk:fix/control-glyph-mapping

Conversation

@nurikk

@nurikk nurikk commented Sep 18, 2026

Copy link
Copy Markdown

Summary

  • treat a decoded null ToUnicode mapping as unusable rather than emitted text
  • fall through to the existing glyph-name recovery path
  • preserve authoritative Unicode mappings and unresolved-glyph behavior

Why

A PDF character code is a glyph selector, not Unicode U+0000. Partial/broken ToUnicode maps can otherwise place raw null bytes in successful extraction output. This change does not strip nulls or guess a replacement character.

Validation

  • regression test demonstrated 3 failures before the production change
  • native parser build succeeded
  • 32 focused tests passed
  • Ruff format/lint
  • git diff --check

Scope

This only changes null mappings that have an existing /Differences entry. Broader embedded-font recovery remains the concern of #322.

Signed-off-by: Ainur T <1525421+nurikk@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

DCO Check Passed

Thanks @nurikk, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@PeterStaar-IBM
PeterStaar-IBM self-requested a review September 19, 2026 12:48
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.

1 participant