Skip to content

[bug] Web UI: Chinese Markdown files show garbled/mojibake text when opened via /api/files/:id/content (Content-Type missing charset) #256

Description

@zlx

Description

After uploading a Markdown file containing Chinese text, opening it (via /api/files/{id}/content) shows the Chinese characters as garbled mojibake.

Steps to Reproduce

  1. Sign in to the QM Web UI (dev mode)
  2. Upload a Markdown file containing Chinese text, e.g. content # 标题\n这是中文测试
  3. Click the file to open /api/files/{id}/content in the browser
  4. Observe that the Chinese characters render as mojibake (e.g. æ ‡é¢˜)

Expected Behavior

Chinese content should render correctly as UTF-8 text.

Actual Behavior

Chinese text is displayed as garbled mojibake.

Environment

  • QM version: main branch (commit 0f0e0ad)
  • Deployment: local, Web UI dev (cookie-auth) mode
  • Browser: Chrome
  • Node: v24

Notes
• The filename is already correctly UTF-8 encoded via filename*=UTF-8''..., confirming the file itself is stored as UTF-8
• The issue is the missing charset declaration in the response Content-Type header

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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