Code Encoding Issues in VSCode

Resolved 💬 12 comments Opened Sep 20, 2025 by ulgerang Closed Nov 25, 2025
💡 Likely answer: A maintainer (joshka-oai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.39.0

Which model were you using?

gpt-5-codex medium

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

Open VSCode with Codex extension enabled

Write code containing Korean text or UTF-8 based special characters

Use Codex auto-completion/code generation

Save and reopen the file → encoding issues appear

What is the expected behavior?

Codex should generate and autocomplete code in VSCode while preserving UTF-8 encoding, so that text is displayed correctly without corruption.

What do you see instead?

Instead of the original Korean text:

// 초기 내러티브 생성

Codex outputs or saves it as:
// ?λ뜃由???^@??怨뺥닏 ??밴쉐

Additional information

_No response_

View original on GitHub ↗

12 Comments

Yoralex1 · 10 months ago

Same for the special characters: é, è, ô of french language

Ashnton · 10 months ago

Same for å, ä and ö in swedish. Instead I get the following å => Ã¥, ä => ä, ö => ö. Capital letters get destroyed in a similar fashion.

NicTanghe · 9 months ago

When it generates code on windows that i use with lvim. there is a weird encoding issue its not that it doesnt use utf-8 and its not that i wind up with either widnows or linux linebreaks.

The end result is that the first 2 letters are cut off of a lot of lines when not in paste mode. in paste mode the text is just fine.

Yoralex1 · 9 months ago

Sometimes when the agent is reading files and see special characters, he "see" them as mojibake and think its a character encoding issue. The agent then replace all the special characters with mojibake accross the code base. Its very annoying.

joshka-oai contributor · 9 months ago

I suspect this may possibly be fixed by https://github.com/openai/codex/pull/4921, in the codex-cli, but there may be an extension bug here as well as a cli bug.

etraut-openai contributor · 7 months ago

This is fixed in recent versions of the CLI.

tgthiag · 7 months ago
This is fixed in recent versions of the CLI.

No, it's not

etraut-openai contributor · 7 months ago

@tgthiag, can you provide more details?

salimbene · 7 months ago

I'm still experiencing this issue while working on windows. Files are saved with strange characters instead of accents (spanish)

<img width="924" height="529" alt="Image" src="https://github.com/user-attachments/assets/f907f3b8-98bd-44e9-9a51-3f26da90abf5" />

tgthiag · 7 months ago

It's the same problem everyone is talking about. It turns some Portuguese chars into mojibake. I'm using v0.65, it keeps happening. This morning I asked Grok to teach Codex what it needs to do to avoid it...
!IMG-20251209-WA0030.jpg

@tgthiag, can you provide more details?
gaetancapraro-hash · 6 months ago

I'm having the same frustrating problem. Do you have any news on how to solve this issue?

etraut-openai contributor · 6 months ago

@gaetancapraro-hash, this bug report is closed. If you're seeing a similar issue, please open a new bug report and provide details as requested in the bug template.