codex - 💡(How to fix) Fix Mac app: local Markdown images fail to render when path contains non-ASCII characters [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20166Fetched 2026-04-30 06:32:51
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
labeled ×2

In the Codex desktop app on macOS, local Markdown images can render as broken placeholders when the absolute filesystem path contains non-ASCII characters, such as CJK characters.

Root Cause

Codex often needs to return generated local artifacts using Markdown image syntax. When the image preview silently fails, users cannot inspect generated images inside the conversation even though the files themselves are valid and readable on disk.

Code Example

![preview](/tmp/codex-local-image-repro/中文目录/test.png)

---

mkdir -p /tmp/codex-local-image-repro/中文目录
   # create or copy any valid PNG to:
   # /tmp/codex-local-image-repro/中文目录/test.png

---

![preview](/tmp/codex-local-image-repro/中文目录/test.png)
RAW_BUFFERClick to expand / collapse

Summary

In the Codex desktop app on macOS, local Markdown images can render as broken placeholders when the absolute filesystem path contains non-ASCII characters, such as CJK characters.

Why this matters

Codex often needs to return generated local artifacts using Markdown image syntax. When the image preview silently fails, users cannot inspect generated images inside the conversation even though the files themselves are valid and readable on disk.

Example

A Markdown image with a local absolute path like this may show as a broken image placeholder in the chat UI:

![preview](/tmp/codex-local-image-repro/中文目录/test.png)

The same PNG file is valid and can be opened by local image tools. The issue appears to be in the app's local image rendering/path handling layer rather than in the image file itself.

Reproduction steps

  1. On macOS, create a PNG under a directory whose path contains non-ASCII characters, for example:

    mkdir -p /tmp/codex-local-image-repro/中文目录
    # create or copy any valid PNG to:
    # /tmp/codex-local-image-repro/中文目录/test.png
  2. Ask Codex to return the image in chat using Markdown with the absolute local path:

    ![preview](/tmp/codex-local-image-repro/中文目录/test.png)
  3. Observe that the image may appear as a broken placeholder instead of rendering inline.

Expected behavior

The Codex desktop app should render local Markdown images from valid absolute filesystem paths, including paths containing UTF-8 / non-ASCII characters.

Actual behavior

The image preview fails in the chat UI and displays a broken placeholder, while the PNG file itself is valid.

Notes

  • Please treat the path above as a synthetic repro path; no user-specific path or project name is included here.
  • This may be related to URL/path encoding for local files in the Markdown image renderer.
  • A useful control test is to copy the same file to an ASCII-only path and compare rendering behavior.

Related issues that may share path-handling code

  • #14576
  • #15463
  • #17548
  • #17992

extent analysis

TL;DR

The issue can be mitigated by ensuring proper URL encoding of non-ASCII characters in local filesystem paths used in Markdown image syntax.

Guidance

  • Verify that the issue is indeed related to URL/path encoding by comparing the rendering behavior of the same image file when placed in an ASCII-only path versus a path with non-ASCII characters.
  • Investigate the Markdown image renderer's handling of local file paths, focusing on how it encodes or decodes non-ASCII characters.
  • Consider implementing a workaround that involves manually encoding non-ASCII characters in the path using URL encoding (e.g., % encoding for special characters) before passing the path to the Markdown image renderer.
  • Review related issues (#14576, #15463, #17548, #17992) for potential insights into shared path-handling code that may be contributing to the problem.

Example

No code example is provided due to the lack of specific implementation details in the issue description.

Notes

The provided guidance assumes that the issue is related to path encoding, which is a common cause of problems when dealing with non-ASCII characters in file paths. However, without more information about the specific implementation of the Markdown image renderer, it's difficult to provide a more detailed solution.

Recommendation

Apply workaround: Manually encode non-ASCII characters in local filesystem paths used in Markdown image syntax to ensure proper rendering, as this approach directly addresses the suspected root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The Codex desktop app should render local Markdown images from valid absolute filesystem paths, including paths containing UTF-8 / non-ASCII characters.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING