Skip to content

Bug: Copying Japanese text from chat output results in mojibake (UTF-8 misinterpreted as Latin1) #30068

Description

@flanny7

Description

Description

When copying Japanese text directly from the chat output in OpenCode, the text becomes mojibake. The same text displays correctly on screen, but becomes corrupted only when copied to the clipboard.

This issue appears to be specific to the copy operation within the OpenCode UI.

Steps to Reproduce

  1. Open OpenCode and interact with the AI in Japanese.
  2. Ask the AI to output Japanese text (e.g. a commit message, PR title, or code comment).
  3. Select the Japanese text from the chat output and copy it (using mouse selection or any built-in copy functionality).
  4. Paste the text into any application (terminal, editor, etc.).

Expected Behavior

The Japanese text should be copied correctly as UTF-8.

Example of correct text:

feat(calendar): 日詳細ボトムシート(P3)を追加

Actual Behavior

The copied text is garbled. It appears that the UTF-8 byte sequence is being misinterpreted as ISO-8859-1 / Windows-1252.

Example of actual copied result:

feat(calendar): æ¥è©³ç´°ããã ã·ã¼ãï¼P3ï¼ã追å 

Environment

  • OpenCode version: 1.15.12
  • OS: macOS
  • Terminal / Environment: VS Code integrated terminal
  • Locale: Japanese (Japan)
  • How you are copying: Mouse drag selection

Additional Context

This seems to be a problem in the clipboard / text extraction layer rather than the rendering layer.

Plugins

No response

OpenCode version

1.15.12

Steps to reproduce

  1. Open OpenCode and interact with the AI in Japanese.
  2. Ask the AI to output Japanese text (e.g. a commit message, PR title, or code comment).
  3. Select the Japanese text from the chat output and copy it (using mouse selection or any built-in copy functionality).
  4. Paste the text into any application (terminal, editor, etc.).

Screenshot and/or share link

No response

Operating System

macOS 26.5

Terminal

VS Code integrated terminal

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions