ITADN

Japanese characters garbled in code blocks on Windows (monospace font fallback)

#1822ClosedTsunetaka 创建于 2026-06-27
T
Tsunetakacommented
## Environment - OS: Windows 11 + WSL2 (Ubuntu 24.04), accessing via Chrome/Edge - MulmoClaude version: (latest main) ## Summary In the chat UI, inline code spans and code blocks that contain Japanese (CJK) characters appear as garbled text (replacement characters / tofu) on Windows. The same content renders correctly on macOS. ## Steps to reproduce 1. Ask Claude to output code that includes Japanese variable names, comments, or any Japanese text inside a fenced code block. 2. View the response in a browser on Windows. 3. Japanese characters inside `` `backtick spans` `` or fenced code blocks appear garbled or as blank boxes. ## Expected behavior Japanese text inside code blocks renders correctly on Windows, the same as on macOS or Linux. ## Root cause `src/index.css` declares the monospace font stack for `.markdown-content code` as: ```css font-family: ui-monospace, SFMono-Regular, monospace; ``` On Windows, neither `ui-monospace` nor `SFMono-Regular` is available, so the browser falls back to the generic `monospace` keyword, which resolves to **Courier New**. Courier New does not cover CJK characters, causing Japanese text to be displayed as tofu. ## Proposed fix Insert Windows-native monospace fonts — **Consolas** (full Latin coverage) and **MS Gothic** / **BIZ UDGothic** (Japanese monospace) — before the generic `monospace` fallback: ```css font-family: ui-monospace, SFMono-Regular, Consolas, "MS Gothic", "BIZ UDGothic", monospace; ``` This preserves macOS/Linux behavior (`ui-monospace` / `SFMono-Regular` take priority) while giving Windows users a proper Japanese monospace font.
关闭于 2026-06-27 0 条评论