System prompts force ASCII-only output, breaking support for non-English languages #8783

Open
opened 2026-02-16 18:10:50 -05:00 by yindo · 2 comments
Owner

Originally created by @diegonix on GitHub (Feb 7, 2026).

Originally assigned to: @thdxr on GitHub.

Description

The system prompts contain an instruction that causes LLMs to avoid non-ASCII characters by default:

Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.

This instruction appears in all model-specific prompt files:

  • codex_header.txt
  • anthropic.txt
  • beast.txt
  • gemini.txt
  • qwen.txt
  • trinity.txt
  • copilot-gpt-5.txt

While the intent is to prevent encoding issues in code files, LLMs interpret this broadly and apply it to all output, including conversational text. This effectively breaks support for any language that uses diacritics or non-Latin scripts.

Affected Languages

Language Missing Characters Example
Portuguese ç, ã, á, é, í, ó, ú, ô, ê "ação" → "acao"
Spanish ñ, á, é, í, ó, ú, ü "año" → "ano"
French é, è, ê, ë, à, â, ç, ô, î, ï, û, ù "français" → "francais"
German ä, ö, ü, ß "größe" → "grosse"
Polish ą, ć, ę, ł, ń, ó, ś, ź, ż "żółć" → "zolc"
Turkish ç, ğ, ı, ö, ş, ü "güneş" → "gunes"
Nordic (Swedish, Norwegian, Danish) å, ä, ö, æ, ø "blåbär" → "blabar"
Vietnamese ă, â, đ, ê, ô, ơ, ư + tones Severely broken
Russian, Ukrainian, Greek Cyrillic, Greek alphabets Completely unusable
Chinese, Japanese, Korean CJK characters Completely unusable
Arabic, Hebrew RTL scripts Completely unusable

Plugins

none

OpenCode version

1.1.53

Steps to reproduce

  1. Configure opencode with GPT-5.2

  2. Add a user prompt requesting output in a non-English language, e.g.:
    Always respond in Brazilian Portuguese with correct spelling and accents.

  3. Ask any question

  4. Observe that the response lacks proper diacritics/accents
    Expected: "A função executa a ação corretamente."
    Actual: "A funcao executa a acao corretamente."

Suggested Fix

Scope the ASCII constraint to code file editing only, and explicitly allow Unicode in conversational output:

## Editing constraints
-- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.
++ When editing or creating source code files, prefer ASCII for identifiers and comments unless the project already uses non-ASCII characters. This constraint does NOT apply to conversational responses, documentation, or user-facing text—use proper Unicode characters as appropriate for the language.



### Screenshot and/or share link

_No response_

### Operating System

Ubuntu 24.04.4

### Terminal

Ghostty 1.2.3
Originally created by @diegonix on GitHub (Feb 7, 2026). Originally assigned to: @thdxr on GitHub. ### Description The system prompts contain an instruction that causes LLMs to avoid non-ASCII characters by default: `Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.` This instruction appears in **all** model-specific prompt files: - `codex_header.txt` - `anthropic.txt` - `beast.txt` - `gemini.txt` - `qwen.txt` - `trinity.txt` - `copilot-gpt-5.txt` While the intent is to prevent encoding issues in code files, LLMs interpret this broadly and apply it to **all output**, including conversational text. This effectively breaks support for any language that uses diacritics or non-Latin scripts. ## Affected Languages | Language | Missing Characters | Example | |----------|-------------------|---------| | Portuguese | ç, ã, á, é, í, ó, ú, ô, ê | "ação" → "acao" | | Spanish | ñ, á, é, í, ó, ú, ü | "año" → "ano" | | French | é, è, ê, ë, à, â, ç, ô, î, ï, û, ù | "français" → "francais" | | German | ä, ö, ü, ß | "größe" → "grosse" | | Polish | ą, ć, ę, ł, ń, ó, ś, ź, ż | "żółć" → "zolc" | | Turkish | ç, ğ, ı, ö, ş, ü | "güneş" → "gunes" | | Nordic (Swedish, Norwegian, Danish) | å, ä, ö, æ, ø | "blåbär" → "blabar" | | Vietnamese | ă, â, đ, ê, ô, ơ, ư + tones | Severely broken | | Russian, Ukrainian, Greek | Cyrillic, Greek alphabets | Completely unusable | | Chinese, Japanese, Korean | CJK characters | Completely unusable | | Arabic, Hebrew | RTL scripts | Completely unusable | ### Plugins none ### OpenCode version 1.1.53 ### Steps to reproduce 1. Configure opencode with GPT-5.2 2. Add a user prompt requesting output in a non-English language, e.g.: `Always respond in Brazilian Portuguese with correct spelling and accents.` 3. Ask any question 5. Observe that the response lacks proper diacritics/accents **Expected:** "A função executa a ação corretamente." **Actual:** "A funcao executa a acao corretamente." ## Suggested Fix Scope the ASCII constraint to **code file editing only**, and explicitly allow Unicode in conversational output: ```diff ## Editing constraints -- Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them. ++ When editing or creating source code files, prefer ASCII for identifiers and comments unless the project already uses non-ASCII characters. This constraint does NOT apply to conversational responses, documentation, or user-facing text—use proper Unicode characters as appropriate for the language. ### Screenshot and/or share link _No response_ ### Operating System Ubuntu 24.04.4 ### Terminal Ghostty 1.2.3
yindo added the bug label 2026-02-16 18:10:50 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 7, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #12441: Project avatar fallback doesn't support emoji characters - While focused on avatar rendering, it reveals the same underlying issue: JavaScript string handling and Unicode character support (emoji handling with surrogate pairs)
  • #12197: garbled characters in darwin vscode terminal - Related to character rendering issues, though in a different context

The core issue in #12609 is that system prompts impose ASCII-only constraints globally, affecting all output including conversational text in non-English languages. This is distinct from the avatar emoji rendering issue but shares related Unicode handling concerns.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Feb 7, 2026): This issue might be a duplicate of existing issues. Please check: - #12441: Project avatar fallback doesn't support emoji characters - While focused on avatar rendering, it reveals the same underlying issue: JavaScript string handling and Unicode character support (emoji handling with surrogate pairs) - #12197: garbled characters in darwin vscode terminal - Related to character rendering issues, though in a different context The core issue in #12609 is that system prompts impose ASCII-only constraints globally, affecting all output including conversational text in non-English languages. This is distinct from the avatar emoji rendering issue but shares related Unicode handling concerns. Feel free to ignore if none of these address your specific case.
Author
Owner

@diegonix commented on GitHub (Feb 16, 2026):

I know there are more important features and bugs to address, but OpenCode is now a global project with users all around the world. Please fix this for us.
There is a damn system_prompt preventing the LLM from doing what it does best - writing correctly in a human language.

Image
@diegonix commented on GitHub (Feb 16, 2026): I know there are more important features and bugs to address, but OpenCode is now a global project with users all around the world. Please fix this for us. There is a damn system_prompt preventing the LLM from doing what it does best - writing correctly in a human language. <img width="1001" height="95" alt="Image" src="https://github.com/user-attachments/assets/dbfb18b2-20ca-4ecd-9b02-29f969f36590" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8783