Patch fails on special characters
Resolved 💬 9 comments Opened Dec 14, 2025 by shakilkhan496 Closed Jan 15, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the VS Code extension are you using?
latest
What subscription do you have?
chatgpt plus
Which IDE are you using?
VS Code
What platform is your computer?
Microsoft Windows NT 10.0.26120.0 x64 Microsoft Windows NT 10.0.26120.0 AMD64
What issue are you seeing?
Codex sometimes do very struggles to patch on long file code, so it takes a long time to respond in Windows PowerShell mode
What steps can reproduce the bug?
try to edit a large file with codex
What is the expected behavior?
it should patch properly
Additional information
The issue is that it generates correct code, but it fails when applying a patch that includes certain special characters. As a result, it deletes the entire file and recreates it from scratch, which increases both token usage and processing time.
9 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Can you provide more details? You mentioned "special characters" in the bug title. Can you be more specific? Are you talking about non-ASCII unicode characters?
Please use the
/feedbackcommand to upload a session where this has occurred and post the thread ID here.Without additional details, it's unlikely we'll be able to diagnose this.
Hi @etraut-openai — thanks for taking a look.
By “special characters” I mean cases where the patch includes non-ASCII Unicode and/or characters that are commonly tricky in diffs. In my repros it’s happened with things like:
“ ” ‘ ’ — –What I see on Windows (VS Code + PowerShell terminal):
Repro (minimal):
.ts/.tsxfile (1k+ lines).“quotes” — dashesand some non-ASCII text.I’ll use
/feedbackto upload a session where this occurred and will paste the thread ID here (and I can also attach a minimal sample file if that helps).Hey @shakilkhan496 , can you provide the thread-id via the
/feedbackcommand? Thanks.<img width="711" height="829" alt="Image" src="https://github.com/user-attachments/assets/517ece73-8b91-496e-b8d2-4d8cbd17c413" />
Look, I just said to update the footer design; it is taking 40 minutes and involves deleting and editing files with a loop.
Hey,
german user on windows system here. I found this issue and think this could be related. If not, just say, then i will open an other issue.
In my case, i have a german markdown file with non-ascii characters, like "ü" etc. Codex tries to do then editing with powershell, which is unstable (encoding, escaping)...
I hope my feedback id helps.
If you need more informations, just ask! This is strange and anoying, so i hope this can be fixed.
Feedback-id: 019b4017-14db-7611-850e-1ef10f0e575a
We merged an experimental fix for shell output encoding in https://github.com/openai/codex/pull/7902, which should help with this. You can test out by running
codex --enable powershell_utf8or addingfeatures.powershell_utf8 = trueto your config.toml.@christopherpross @shakilkhan496 can you try this feature out and let us know if it works for you?
Sure thanks I will try soon! Really appreciate 🙏
@dylan-hurd-oai Perfect, everything works great, and super-fast editing after
features.powershell_utf8 = truethis update.