Skip to content

extension: previewing a docx file with Chinese characters in the filename on Windows fails #782

Open

Description

@austin3dickey

Bug description

Originally reported in posit-dev/positron#8834. VS Code and Positron aren't able to open the preview for a file named 文档.qmd if the format is docx.

Steps to reproduce

In VS Code or Positron on Windows,

  • open a new file named 文档.qmd
  • add
---
title: "hey"
format: docx
---

hi

and save

  • run the Quarto Preview command
  • in the "Render complete - View preview" popup, click the button
  • In VS Code, nothing happens. In Positron, we get a popup that says "An error occurred opening an external program. Failed to open: The system cannot find the file specified. (0x2)"

Actual behavior

No response

Expected behavior

The file should open in MS Word if that's what's configured as the default.

Your environment

No response

Activity

  1. added
    bug
    on Aug 8, 2025
  2. cscheid commented on Aug 19, 2025

    @cscheid
    Member

    @austin3dickey Does this persist if you type quarto preview 文档.qmd in a shell? I suspect this might be a bug for quarto-cli instead of here.

  3. JTCDCTWB commented on Aug 20, 2025

    @JTCDCTWB

    @austin3dickey Does this persist if you type quarto preview 文档.qmd in a shell? I suspect this might be a bug for quarto-cli instead of here.

    This issue does not occur in RStudio, so I think the problem might not be with quarto-cli.

  4. avila commented on Oct 15, 2025

    @avila

    I wanted to comment on posit-dev/positron#8834 but since the issue is already closed, Ill comment here.

    I think it is not a quarto issue, as one can see in the following reprex:

    dir.create("tütü")
    setwd("tütü")
    browseURL(".")   # Does not work on Positron
    shell.exec(".")  # this works on Positron
    
    # just cleaning up
    setwd("..")
    unlink("tütü", recursive = TRUE)

    The above works on RStudio, but not on Positron. If the directory contains a non-ASCII character, it returns the Ox2 "Failed to open" error (even if the non-ASCII character is in a higher-level folder).
    I would say the issue opening the docx file (as stated in posit-dev/positron#8834) is likely due to the name of the folder containing it, rather than the filename itself.

    Finally, with shell.exec("."), it works fine in Positron as well. (Note that the issue with shell.exec() is that one would need to revert the slashes if the one would like to open a sub-folder)

    I hope these bits are informative and helpful to further debug this issue.

    Positron info

    Positron Version: 2025.10.0 (user setup) build 199
    Code - OSS Version: 1.103.0
    Commit: 81d0c98dbf719e29097b9c700877398d7af13138
    Date: 2025-10-09T17:54:48.567Z
    Electron: 37.2.3
    Chromium: 138.0.7204.100
    Node.js: 22.17.0
    V8: 13.8.500258-electron.0
    OS: Windows_NT x64 10.0.19045
    
  5. cderv commented on Oct 15, 2025

    @cderv
    Member

    @avila, maybe open a new issue in Positron regarding browseURL() usage as this is not quarto preview related ?

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions