Skip to content

fix(pdf): normalize Arabic presentation forms (RTL phase 1) - #2539

Open
Islam El-Nashar (aslamalkarywk7) wants to merge 1 commit into
microsoft:mainfrom
aslamalkarywk7:fix-pdf-rtl-phase1
Open

Islam El-Nashar (aslamalkarywk7) wants to merge 1 commit into
microsoft:mainfrom
aslamalkarywk7:fix-pdf-rtl-phase1

Conversation

@aslamalkarywk7

Copy link
Copy Markdown

Related to #2336 (Phase 1 of the plan proposed there).

Some PDF producers emit Arabic Presentation Forms (U+FB50-U+FDFF, U+FE70-U+FEFF) instead of standard letters, which breaks downstream matching and LLM extraction. PdfConverter now normalizes exactly those two ranges to standard Unicode (NFKC per character, so ligatures expand too); everything else passes through byte-identical. Applied as a post-processing stage next to the existing numbering merge, so all extraction paths are covered.

Out of scope for this phase (stated openly): full BiDi reading-order reconstruction and RTL table column handling need the reporter redacted fixtures offered in the issue (or a new bidi dependency) — proposed as Phase 2 once fixtures land.

Verification: new tests/test_pdf_rtl.py (5 tests, fixtures use explicit escapes so they are encoding-proof) pass; existing pdf suites (masterformat, tables: 27 tests) pass unchanged.

@aslamalkarywk7

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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