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

