Skip to content

Codex writing special characters like norwegain æåø as mojibake #13743

Open

Description

@AdrianNO1

What version of Codex CLI is running?

codex-cli 0.110.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.4. Also occured with gpt-5.3-codex

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

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

No response

What issue are you seeing?

Often when Codex is writing special charactes like norwegain æ, ø and å, they turn to mojibake, like "å" turning into "Ã¥". This has been a recurring issue for me ever since I started using Codex a couple weeks ago. This doesn't always happen, if I tell it to fix the mojibake it manages to fix it, so I am not sure how it arises in the first place.

Sometimes Codex realizes its mistake and starts writing unicode escape sequences directly into strings, instead, but that just makes the strings hard for a human to read.

This doesn't happen with just æøå. I have also noticed the same issue with other special characters like U+200B.

What steps can reproduce the bug?

Uploaded thread: 019cc35c-e806-7ff1-888a-63d3c2618735

What is the expected behavior?

The expected behaviour is that Codex is consistently capable of writing characters like æøå when editing files.

Additional information

No response

Activity

  1. added
    CLIIssues related to the Codex CLI
    windows-osIssues related to Codex on Windows systems
    on Mar 6, 2026
  2. github-actions commented on Mar 6, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. etraut-openai commented on Mar 6, 2026

    @etraut-openai
    Contributor

    If you're able to repro this, please use /feedback to upload your session details and post the thread ID here. We need to determine whether this is model behavior (i.e. behavior that's intrinsic to the model) or a bug in the Codex harness, perhaps related to character encoding. Session details will help us determine which it is.

  4. AdrianNO1 commented on Mar 6, 2026

    @AdrianNO1
    Author

    If you're able to repro this, please use /feedback to upload your session details and post the thread ID here. We need to determine whether this is model behavior (i.e. behavior that's intrinsic to the model) or a bug in the Codex harness, perhaps related to character encoding. Session details will help us determine which it is.

    The Thread ID is the same as above, 019cc35c-e806-7ff1-888a-63d3c2618735. I dug this screenshot up from earlier today, it says the feedback was uploaded so ya'll have the details right?
    Image

  5. cybervand commented on Mar 10, 2026

    @cybervand

    i can confirm that codex has done this for me as well. I think the replication process is to use claude to make a document, it uses alot of characters in the utf8 and ascii. but when codex edits these files it corrupts the documents turning the characters into mojibake.

  6. added
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    and removed
    CLIIssues related to the Codex CLI
    on Mar 16, 2026
  7. added
    tool-callsIssues related to tool calling
    and removed
    model-behaviorIssues related to behaviors exhibited by the model
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    on Mar 29, 2026
  8. COPK commented on Apr 3, 2026

    @COPK

    Using Codex, I am constantly encountering this problem regardless of the language I am working in. The latest ChatGPT LLMs generate authentic mojibake, and this is the reason why I stopped using them. The amount of tokens consumed in continuous corrections, which in many cases do not end up solving the errors, makes the use of ChatGPT unacceptable.

  9. myvirtualclone commented on Apr 5, 2026

    @myvirtualclone

    I second this! Have the same problem ALL the time. Likely need to stop using Codex as a result. That said, I am no experimenting with adding this instruction which could be Windows-specific: Use PowerShell’s safer line-level encoding to avoid mojibake rewrite problems.

  10. MNeMoNiCuZ commented on Apr 12, 2026

    @MNeMoNiCuZ

    This started happening recently, some time in March for me as well. For any project, not only for language/country specific character, but any special character it's using, like a checkmark, or a filled line, tree-list symbols or whatever. Things that just used to work is now always getting broken when it's coding.

    I found encoding corruption on the checkmark symbols (✔/✖) and I’m restoring those lines to explicit Unicode escapes so they render correctly and avoid mojibake.
    
  11. shiraz-123 commented on Jun 5, 2026

    @shiraz-123

    the isssue still persists (gpt-5.5 high)

  12. AdrianNO1 commented on Jun 5, 2026

    @AdrianNO1
    Author

    the isssue still persists (gpt-5.5 high)

    I added to my system instructions to always read/write files using UTF-8 (no BOM). This has worked for many months but yesterday it had the issue again and converted all non-ASCII characters into mojibake in a file it edited.

    It hasn't happened again since but it's quite the coincidence that shiraz-123 responds here at the same time.

  13. MNeMoNiCuZ commented on Jun 5, 2026

    @MNeMoNiCuZ

    @etraut-openai
    Any concern about this behavior? I don't see how it can be on the user-side as it keeps happening. We need to instruct our agents to not behave in the default way they are behaving. It seems wrong.

  14. icaroperetti commented on Jul 13, 2026

    @icaroperetti

    Still happening

  15. dimitar-grigorov commented on Jul 26, 2026

    @dimitar-grigorov

    Might help narrow this down. Check the bytes on disk after a bad edit: c3 a5 is correct UTF-8 for å, while c3 83 c2 a5 means it got double-encoded on the way out. If the file is correct on disk but the agent still shows Ã¥ in context, the corruption is on the read side rather than the write side, which matches #15422.

    Routing file reads and writes through an MCP server with its own file I/O avoids the console-codepage path entirely. I maintain one, so treat this as a biased suggestion rather than a fix: https://github.com/dimitar-grigorov/mcp-file-tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions