Failed to apply patch due to encoding issues

Open 💬 3 comments Opened Jan 21, 2026 by tengmmvp

What version of Codex is running?

0.87.0

What subscription do you have?

Chatgpt Plus

Which model were you using?

gpt-5.2-codex

What platform is your computer?

Microsoft Windows NT 10.0.26220.0 x64

What terminal emulator and version are you using (if applicable)?

Windows Terminal

What issue are you seeing?

✘ Failed to apply patch
└ execution error: Io(Custom { kind: Other, error: "windows sandbox join error: task 5601 panicked with message \"byte index 200 is not a char
boundary; it is inside '阴' (bytes 199..202) of D:\\\\Download\\\\npm-global\\\\node_modules\\\\@openai\\\\codex\\\\vendor\\\\x86_64-pc-windows-msvc\
\\\codex\\\\codex.exe --codex-run-as-apply-patch *** Begin Patch\\n*** Update File: frontend/src/styles/variables.css\\n@@\\n /* 阴影 */\\n --sm-
shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04)
[...]\"" })
• The patch tool fails on non-ASCII Chinese characters, so I'll avoid apply_patch and use a Python script to insert lines after the --sm-shadow-2
substring, ensuring ASCII safety.

What steps can reproduce the bug?

This issue may occur when Chinese characters are present in the code.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗