Skip to content

[Bug]: RTF attachment extraction drops named joiners and direction marks #36823

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

Attach an RTF file containing {\rtf1\ansi A\zwj B\zwnj C\ltrmark D\rtlmark E} and inspect the extracted .rtf.txt sidecar produced by DocumentText.ensure. The same behavior is reachable through composer and question-answer attachments.

OpenJDK 17 RTFEditorKit also produces a real example: writing क्‍ष emits \u2325 ?\u2381 ?\zwj\u2359 ?.

Expected behavior

The extracted text preserves ZWJ U+200D, ZWNJ U+200C, LRM U+200E and RLM U+200F, as equivalent Unicode escapes do.

Actual behavior

Named forms silently disappear: the first example becomes ABCDE, and the JDK example loses U+200D. This can change joining or directional meaning in the text an agent reads. The original RTF remains available. This report concerns provider attachment extraction, separate from the web preview fix #36767.

Impact

Minor bug or occasional failure

Version or commit

Reproduced on pingdotgg/main at 2eb8829. Independently confirmed by Claude Opus 5.5 on 0d585f7.

Environment

Linux, Node v24.19.0; server document extraction. No paid provider turn required.

Logs or stack traces

extractDocumentText and DocumentText.ensure regression fails on base and passes with the named-symbol mappings. Real __document-text subprocess output for A\zwj B\zwnj C\ltrmark D\rtlmark E:

base: 41 42 43 44 45
fix:  41 e2 80 8d 42 e2 80 8c 43 e2 80 8e 44 e2 80 8f 45

Workaround

Use equivalent \uN escapes or read the original RTF. Existing cached sidecars need regeneration.

Activity

  1. added
    vouch:trusted
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions