Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chinese file name failed to open #5

Open
weisanju opened this issue May 23, 2020 · 9 comments
Open

Chinese file name failed to open #5

weisanju opened this issue May 23, 2020 · 9 comments

Comments

@weisanju
Copy link

when I selected the file used Chinese name with extension name "md" , it did't response

带中文的文件名 无法在外部应用打开

@tjx666
Copy link
Owner

tjx666 commented Jun 3, 2020

Known issue, as long as the path contains non-ascii characters, it cannot be opened because the API used by the extension vscode.env.openExternal is not supported by itself.
After a few days, I will try to solve this problem.

已知问题,只要路径带有非 ascii 字符就打不开,因为扩展使用的 API vscode.env.openExternal 本身不支持。等过几天有空我会尝试解决这个问题。

@tjx666
Copy link
Owner

tjx666 commented Jun 6, 2020

Need VSCode provide new API or update API vscode.env.openExternal, No suitable solution has been found. See microsoft/vscode#85930

@kcheart
Copy link

kcheart commented Jun 19, 2020

I like to report trying result under macOS (10.15.5 Catalina) with this extension,
I can open external file into Typora with Traditional Chinese file name and Traditional Chinese path name.

And it seems I do not need to set up the configuration with isElectronApp option.
I only put the following setting in setting.json, and it works good.

    "openInExternalApp.openMapper": [
        {
            "extensionName": "md",
            // apps can be Object array or just is openCommand
            // the code is command you can access from shell
            "apps": "typora"
        }
    ]

@tjx666
Copy link
Owner

tjx666 commented Jun 19, 2020

@kcheart Seems package: open works fine on MacOS, but not on Windows if application is made by electron.

@tjx666 tjx666 closed this as completed Feb 2, 2022
@tjx666
Copy link
Owner

tjx666 commented Jun 13, 2022

@weisanju can you try the latest version? I don't using windows now...

@tjx666 tjx666 reopened this Jun 13, 2022
@King-of-Infinite-Space
Copy link
Collaborator

The change in 9e1b8f3 is inside the if clause, so it has no effect for non-ascii paths.
I tried removing the if clause. The app did not open. Typora was set as default app in Windows 11, no extension config in VSCode (version 1.69.2).

Just a feedback as this is not my use case. Maybe other extension (e.g. code runner) can be used as a workaround.

@YDX-2147483647
Copy link

As mentioned by King-of-Infinite-Space, the workaround with Code Runner works. It creates/opens a terminal then enters commands.

Settings for it
  • Add "markdown": "start typora $fullFileName" into code-runner.executorMap.

  • Make sure code-runner.runInTerminal is true.

GitLens also uses a terminal for complex git operations (eg. deleting a branch).

— This might be the third way to open files.

@tjx666
Copy link
Owner

tjx666 commented Dec 24, 2022

check the latest info here: microsoft/vscode#85930 (comment)

@BlankSeed
Copy link

BlankSeed commented Apr 10, 2023

Is there any solution for non-ascii charaters in the path in Windows?

I installed npm and the 'open' package from the command line. However, it seems that the installation is not working in vscode as when I open a doc file, the path error still occurs.

Any suggestions? thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants