Cursor Can't Handle Attached DOCX Files

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When attaching files that contain binary data in the Chat (Office documets like docx, xlsx, PDF files sometimes) the files are read as UTF-8 and are uploaded that way to the LLM. The UTF-8 encoding can’t handle all the binary bytes and some are replaced with the Unicode Replacement Character - EF BF BD.
This change is unrecoverable and indeed Cursor IDE will always then create a script to read the file’s content - wasting a lot of tokens.

Steps to Reproduce

Attach a docx file to Cursor chat, and watch the traffic to see it is malfored.
Also notice Cursor creating and using script to read the file’s content.

Expected Behavior

Cursor uploads the file in a different encoding that doesn’t corrupt it, or reads its content directly instead of generating a script each time

Screenshots / Screen Recordings

Operating System

Windows 10/11
MacOS

Version Information

Version: 3.10.17 (user setup)
VS Code Extension API: 1.125.0
Commit: c89f45b831621cdc5e951694db44fecd8fab1150
Date: 2026-07-05T06:39:45.228Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Editor mode agent tab - Auto model, but we also saw it with other models as well

For AI issues: add Request ID with privacy disabled

Request ID: db7ff6aa-1e2b-484a-a77f-9c651a235e9f

Does this stop you from using Cursor

No - Cursor works, but with this issue

Thanks for the detailed report.

This is a bug on our side. When a binary file (Word/Excel, and sometimes PDF) is added to chat by typing @ to reference it or dragging it in from the Explorer, we read it as plain text, which mangles the binary bytes (the EF BF BD replacement characters you saw) before it reaches the model. That’s also why the agent falls back to writing a script to read the file.

Workarounds while we fix this:

  1. PDFs: use the attach button in the chat input to add the PDF instead of @-referencing it. Attached PDFs are read directly (text is extracted properly).
  2. Word/Excel (.docx/.xlsx): these can’t be attached directly yet, so either save/export the content as .txt, .md, or .csv and attach or paste that, or convert to PDF and attach it with the button. Letting the agent open the file with a tool (what you’re seeing) does work — it’s just heavier on tokens.
  3. Until then, avoid @-referencing or dragging raw Office files straight into chat.

I’ve flagged the underlying issue to the team and will update here when there’s progress.

Hi Mohit,

Thank you for the prompt reply. I think you also have a bug in the attach function - it works with PNGs, but when I attach a PDF (that has binary content) it fails, nothing shows in the UI. Not sure if it’s entirely related

Here’s a video of it, as well as the PDF file

london.pdf (973 Bytes)