Support for different file encodings and windows style line endings in apply_patch internal function and codex.exe command line apply patch
Resolved 💬 2 comments Opened May 5, 2026 by primozcerar Closed Jul 1, 2026
What variant of Codex are you using?
App
What feature would you like to see?
Currently apply_patch fails on non UTF-8 encoded files, making codex revert to other commands/tools for patching code and as a consequence there is no file diff report in the app window. I suggest making apply_patch encoding aware either by ascertaining the encoding or by having the encoding passed in as an argument.
Other issue on windows is also that apply_patch uses linux style line endings only (LF) and this causes files with mixed line endings that IDEs then complain about. It should either maintain the current file line endings or have a setting or input argument to allow windows style line endings (CRLF).
Additional information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗