Unicode Input Handling Fails for Vietnamese Characters

Resolved 💬 23 comments Opened Jul 19, 2025 by nhungbeo Closed Mar 5, 2026

Bug Description
Tôi bị lôỗi khi gõ tiếng viêệt!

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 1.0.56
  • Feedback ID: 7b114bfe-3eb8-44a0-a767-4161b53b31a1

Errors

[{"error":"Error: ENOENT: no such file or directory, open 'C:\\proc\\version'\n    at Module.readFileSync (node:fs:441:20)\n    at Object.readFileSync (file:///C:/Users/Administrator/.npm-global/node_modules/@anthropic-ai/claude-code/cli.js:615:7077)\n    at file:///C:/Users/Administrator/.npm-global/node_modules/@anthropic-ai/claude-code/cli.js:615:8638\n    at Q (file:///C:/Users/Administrator/.npm-global/node_modules/@anthropic-ai/claude-code/cli.js:609:14408)\n    at kT4 (file:///C:/Users/Administrator/.npm-global/node_modules/@anthropic-ai/claude-code/cli.js:709:62815)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-19T01:46:53.728Z"},{"error":"RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded\n    at Socket.onChildStdout (node:child_process:482:14)\n    at Socket.emit (node:events:518:28)\n    at Socket.emit (node:domain:489:12)\n    at addChunk (node:internal/streams/readable:561:12)\n    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n    at Readable.push (node:internal/streams/readable:392:5)\n    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)","timestamp":"2025-07-19T01:46:55.107Z"}]

View original on GitHub ↗

23 Comments

letrungtrieu · 11 months ago

Same issue

tuanquok · 11 months ago

same issue with Mac, pls fix

qtnx · 11 months ago

I ran into the same problem. While waiting for the official fix, I created a patch script that you can use as a temporary workaround

<img width="720" height="166" alt="Image" src="https://github.com/user-attachments/assets/f04b0c37-0d48-4bee-8cae-a0e19650571f" />

Source: https://gist.github.com/qtnx/2850b394923e94f7db4cca9446fed660

To apply it, run:

curl -fsSL https://gist.githubusercontent.com/qtnx/2850b394923e94f7db4cca9446fed660/raw/fix-vietnamese-claude-code.sh | bash

It works on macOS and Linux. Windows may require WSL.

Remember to read the script before running it. You might need to reapply the patch after future updates.

tuanquok · 11 months ago
I ran into the same problem. While waiting for the official fix, I created a patch script that you can use as a temporary workaround <img alt="Image" width="720" height="166" src="https://private-user-images.githubusercontent.com/123870525/479008566-f04b0c37-0d48-4bee-8cae-a0e19650571f.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTU1MjkwMDQsIm5iZiI6MTc1NTUyODcwNCwicGF0aCI6Ii8xMjM4NzA1MjUvNDc5MDA4NTY2LWYwNGIwYzM3LTBkNDgtNGJlZS04Y2FlLWEwZTE5NjUwNTcxZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwODE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDgxOFQxNDUxNDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hOGYwMzFiYWM4MzRiNjlmYmU0NTFlMWZlNzliMjYzMmZiN2M2ODRlY2I5OGMxYjdmNmM5YjI3YjUzZGY1ZmE4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.yDA9YV7mZTDlQzxdQaFCo1fBsNH9XTnBbzz6W88DxP0"> Source: https://gist.github.com/qtnx/2850b394923e94f7db4cca9446fed660 To apply it, run: curl -fsSL https://gist.githubusercontent.com/qtnx/2850b394923e94f7db4cca9446fed660/raw/fix-vietnamese-claude-code.sh | bash It works on macOS and Linux. Windows may require WSL. Remember to read the script before running it. You might need to reapply the patch after future updates.

Still face issue, I have log 'Could not find g1 function pattern
This version of Claude Code may have a different structure'

qtnx · 11 months ago
> I ran into the same problem. While waiting for the official fix, I created a patch script that you can use as a temporary workaround > <img alt="Image" width="720" height="166" src="https://private-user-images.githubusercontent.com/123870525/479008566-f04b0c37-0d48-4bee-8cae-a0e19650571f.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTU1MjkwMDQsIm5iZiI6MTc1NTUyODcwNCwicGF0aCI6Ii8xMjM4NzA1MjUvNDc5MDA4NTY2LWYwNGIwYzM3LTBkNDgtNGJlZS04Y2FlLWEwZTE5NjUwNTcxZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwODE4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDgxOFQxNDUxNDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hOGYwMzFiYWM4MzRiNjlmYmU0NTFlMWZlNzliMjYzMmZiN2M2ODRlY2I5OGMxYjdmNmM5YjI3YjUzZGY1ZmE4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.yDA9YV7mZTDlQzxdQaFCo1fBsNH9XTnBbzz6W88DxP0"> > Source: https://gist.github.com/qtnx/2850b394923e94f7db4cca9446fed660 > To apply it, run: > curl -fsSL https://gist.githubusercontent.com/qtnx/2850b394923e94f7db4cca9446fed660/raw/fix-vietnamese-claude-code.sh | bash > It works on macOS and Linux. Windows may require WSL. > Remember to read the script before running it. You might need to reapply the patch after future updates. Still face issue, I have log 'Could not find g1 function pattern This version of Claude Code may have a different structure'

It might not work with the latest version 1.0.84, so I’ll update it.

As a workaround on macOS, you can try:

  1. Using the default Telex keyboard from macOS (works fine) - setup in the Text Input setting.
  2. iTerm2 - sometimes it works.
  3. The terminal in Zed IDE — works without any issues.
qtnx · 11 months ago

I've just updated the script it should work now.

tuanquok · 11 months ago
I've just updated the script it should work now.

You've save my life. Ty ( Cảm ơn bác :)))))

JOY · 10 months ago

Same issue. Please fix.

lucas3g · 9 months ago

Same issue, but with Portuguese (Brazil) Characters...

lucas3g · 8 months ago

UP

lucas3g · 8 months ago

up

pjbaron · 8 months ago

This issue seems to cover a multitude of sins but all the related (and more directly relevant) issues have been closed as duplicates of this, so I'll add details here.

Platform: claude code, windows 11 pro, launched from powershell terminal (git bash not supported, I didn't even consider cmd).

Claude generates code with a LOT of unicode symbols, ticks, crosses, arrows, exclamation icons, but if it tries to run any of this code it will crash the run (not the console) immediately when the symbol is output. Claude will usually recognise the mistake and rewrite the code.
This is a phenomenal waste of tokens and time. The code is fine, it works if I launch it manually and the unicode symbols are not a problem in the powershell terminal. It is ONLY a problem INSIDE Claude Code.

Simple repro:
python

print("✓ Test completed successfully")

Save as bug-test.py
Ask Claude Code to run that script.

Result:

● Bash(cd "F:\ai\The Thinker" && python bug-test.py)
  ⎿  Error: Traceback (most recent call last):
       File "F:\ai\The Thinker\bug-test.py", line 1, in <module>
         print("\u2713 Test completed successfully")
       File "F:\miniconda3\Lib\encodings\cp1252.py", line 19, in encode
         return codecs.charmap_encode(input,self.errors,encoding_table)[0]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     UnicodeEncodeError: 'charmap' codec can't encode character '\u2713' in position 0: character maps to <undefined>

Expected result:
Script should run without error.

Claude Code reports:

  The issue is Windows Command Prompt defaulting to cp1252 encoding instead of UTF-8, preventing unicode characters
  like ✓ (\u2713) from being displayed.

I launch Claude Code from PowerShell terminal, so either the Command Prompt diagnosis is incorrect, or Claude Code ignores its environment and runs code in an unsuitable alternative.

pjbaron · 8 months ago

I have no idea how much of this is hallucination, but Claude Code continued to report:

> I launched code claude inside window PowerShell terminal which doesn't usually have any problems with encoding.
When you run these scripts are you opening a command prompt shell instead of using the host environment?

● You've identified the issue! Looking at the error traceback showing cp1252.py, you're absolutely right - when I
  use the Bash tool, it appears to be spawning a Windows Command Prompt (cmd.exe) process with cp1252 encoding,
  rather than using the PowerShell environment you launched Claude Code from.

  PowerShell uses UTF-8 by default (or at least handles Unicode much better), but cmd.exe defaults to cp1252 which
  causes the unicode errors.

  I don't have direct control over which shell the Bash tool uses, but this is clearly a bug in how Claude Code
  handles the Bash tool on Windows - it should either:

  1. Inherit the shell environment from the host (your PowerShell session)
  2. Set UTF-8 encoding explicitly when spawning child processes: chcp 65001 in cmd.exe
  3. Provide a way to configure which shell to use

  For your bug report, the key details are:
  - Host environment: Windows PowerShell (UTF-8 capable)
  - Expected behavior: Bash tool should use PowerShell or set UTF-8 encoding
  - Actual behavior: Bash tool spawns cmd.exe with cp1252 encoding
  - Evidence: Error shows cp1252.py codec in traceback
  - Impact: Python scripts with unicode characters fail even though host terminal supports them
namkiit · 7 months ago

Same issue. Please fix.

trancong12102 · 7 months ago

https://github.com/trancong12102/claude-code-vime
You can try my script, which has been updated for the latest Claude code version.

khaphanspace · 7 months ago

I have developed a Vietnamese input engine on macOS to fix this issue in Claude Code and other apps. You can use it here:

https://github.com/khaphanspace/gonhanh.org

thanhdongnguyen · 7 months ago

up

thanhdongnguyen · 7 months ago

@claude please fix it

github-actions[bot] · 6 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

JOY · 6 months ago

Up

0x0a0d · 5 months ago

xài https://github.com/0x0a0d/fix-vietnamese-claude-code fix được claude bên npm nha

github-actions[bot] · 4 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.