[BUG] Tables with CJK characters are misaligned in terminal output

Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Dec 9, 2025 · closed Feb 6, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When Claude Code generates tables containing CJK (Chinese, Japanese, Korean) characters, the columns are misaligned in terminal output. Claude does not account for the display width of CJK characters (2 terminal columns) versus ASCII characters (1 column).

Example request:
Create a reference table for the following mobile app error codes. Include columns for: error code, Japanese message, English message, and the screen where it appears.

  • E001: ログインに失敗しました / Login failed / LoginScreen
  • E002: ネットワーク接続エラー / Network connection error / anywhere
  • E003: セッションがタイムアウトしました / Session timed out / all authenticated screens
  • E004: データの読み込みに失敗しました / Failed to load data / HomeScreen, SettingsScreen
  • E005: アプリバージョンが古いです。アップデートしてください / App version outdated. Please update. / LaunchScreen
  • E006: 無効なユーザーIDまたはパスワード / Invalid user ID or password / LoginScreen
  • E007: サーバーメンテナンス中 / Server maintenance in progress / all screens

Claude produces:

| Error Code | Japanese Message           | English Message                      | Screen                     |
|------------|----------------------------|--------------------------------------|----------------------------|
| E001       | ログインに失敗しました                | Login failed                         | LoginScreen                |
| E002       | ネットワーク接続エラー                | Network connection error             | anywhere                   |
| E003       | セッションがタイムアウトしました           | Session timed out                    | all authenticated screens  |
| E004       | データの読み込みに失敗しました            | Failed to load data                  | HomeScreen, SettingsScreen |
| E005       | アプリバージョンが古いです。アップデートしてください | App version outdated. Please update. | LaunchScreen               |
| E006       | 無効なユーザーIDまたはパスワード          | Invalid user ID or password          | LoginScreen                |
| E007       | サーバーメンテナンス中                | Server maintenance in progress       | all screens                |

The column separators (|) do not align vertically.

What Should Happen?

Claude should calculate display width correctly:

  • CJK characters = 2 terminal columns each
  • ASCII characters = 1 terminal column each

Then pad cells to ensure consistent display width per column, producing aligned output.

Error Messages/Logs

(no error - just visual misalignment)

Steps to Reproduce

  1. Ask Claude Code to create a markdown table with Japanese/Chinese/Korean text in one column and English in another, or mixed ASCII / CJK characters within one or more columns. See example above.
  2. Observe that the | column separators do not align vertically

<img width="1498" height="524" alt="Image" src="https://github.com/user-attachments/assets/92a19839-f0a9-4841-9c70-8a3433bca2a2" />

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

i don't recall this being broken before, but it may have always been this way; i just noticed it this week ...

Claude Code Version

Claude Code v2.0.61

Platform

Google Vertex AI

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Although this can (unreliably) be worked around by adding (many lines of) new instructions to CLAUDE.md, or possibly by creating an external tool for CJK formatting and trying to get the tool to use it in this context, this is something that users shouldn't have to waste time customizing ...

(the below generated by claude)

Severity: This required approximately 10 correction attempts during a single conversation before Claude produced a correctly aligned table. The user had to explain
display width concepts and debug the padding character by character.

Root causes identified:

  1. Claude treats all characters as 1 column wide
  2. When attempting to add padding, Claude miscounts or uses inconsistent padding characters
  3. Claude does not distinguish between ASCII spaces (1 col) and full-width spaces (2 cols)

Proposed solution: Add to Claude Code's system instructions or model behavior:

  1. When generating tables with CJK content, calculate display width (2 for wide chars, 1 for narrow)
  2. Use full-width spaces (U+3000) for padding CJK columns
  3. Ensure separator row dash count equals target display width
  4. Output tables in fenced code blocks to preserve spacing

Reference: Unicode Standard Annex #11 (East Asian Width) defines character width properties.

View original on GitHub ↗

5 Comments

github-actions[bot] · 10 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/11274
  2. https://github.com/anthropics/claude-code/issues/11275

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

guppy-jpf · 10 months ago
1. Markdown tables render incorrectly with CJK characters (misaligned columns) #11274 2. Markdown tables render with misaligned columns in web interface #11275

the first issue has been closed, so i can't comment on it. the second issue appears to be a replacement of the first.
however, it is specifically discussing the web interface, and i am using claude code in a terminal.

neper-stars · 9 months ago

I confirm this is the case when generating ASCII tables with box-drawing characters (│, ─, ├, └, etc.), Claude miscalculates padding because it counts UTF-8 bytes instead of display width. This causes closing border characters to be misaligned with the rest of the table.

I suspect the rune size versus byte size issue is the same with a lot of multibytes unicode characters...

cirospaciari · 8 months ago

This has been fixed. The markdown table renderer now uses display width instead of character count, so CJK characters (2 columns wide) are properly accounted for in column alignment.

github-actions[bot] · 8 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.