Skip to content

Relative .md links with Chinese (non-ASCII) paths fail: percent-encoded path treated as literal file #85

Description

@henggongchina

Summary

Clicking a relative Markdown link whose path contains non-ASCII (e.g. Chinese) directory/file names fails with “does not exist”. The error path shows percent-encoded segments used as a literal filesystem path, and the intermediate Chinese directory segment appears to be lost.

Images with relative Chinese paths in the same document render correctly; only navigation links to other .md files fail.

Environment

  • mdview 4.0.1 (Windows x64), installed via winget install c3er.mdview
  • Install path example: D:\Tools\mdview\mdview.exe
  • OS: Windows 10/11

Steps to reproduce

  1. Create this layout (UTF-8 paths):
docs/
  计划/
    plan.md
  证据/
    note.md
  1. In docs/计划/plan.md:
# Plan

See [note](../证据/note.md)
  1. Open plan.md in mdview.
  2. Click the note link.

Expected

Opens:

…\docs\证据\note.md

Actual

Error dialog similar to:

Cannot display: "…\docs\%E8%AF%81%E6%8D%AE-….md" does not exist

Notes from a real case:

  • Source link in Markdown (correct): ../证据/证据-APT10-资源管理器内存OOM-2026-07-17.md
  • Real file exists at: …\docs\证据\证据-APT10-资源管理器内存OOM-2026-07-17.md
  • Error path was under docs\ with a percent-encoded filename, missing the 证据\ directory (or treating %E8%AF%81%E6%8D%AE… literally).

Same-folder ASCII links such as ./other-ascii.md work. Cross-directory links with Chinese path components fail.

Suspected cause

HTML/href uses URL-encoding for non-ASCII path segments, but local file open does not decodeURIComponent (and/or path join drops the encoded directory segment).

Workaround

Open the target file via File → Open, or use another preview (e.g. VS Code / Cursor) for cross-document navigation. Document content and relative images still display fine in mdview.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions