You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PDF (and xlsx/ods) files cannot be opened from Files pane when their filenames/paths include non-ASCII characters #12467
RStudio Edition : Desktop
RStudio Version : 2022.12.0-353 (Elsbeth Geranium)
OS Version : Windows 10/11 Pro 22H2
R Version : 4.2.2
Steps to reproduce the problem
Update Rstudio Desktop from 2022.07.2-576 (Spotted Wakerobin) to 2022.12.0-353.
In Files pane of RStudio, move to a folder where a PDF file is.
Click the PDF file in Files pane.
Describe the problem in detail
When its filename or path includes non-ASCII character(s), the default PDF viewer does not launch and the PDF file is not opened.
In the case below, only London.pdf can be opened by clicking it.
(In contrast, any Rmd file is properly shown in Source pane.)
Describe the behavior you expected
Regardless of its filename or path, a PDF file is opened by clicking it in Files pane.
Additional information
Under the identical conditions mentioned above (non-ASCII characters are included in the filename or path),
when clicking an xlsx file and selecting View File in Files pane, Excel does not launch and the file is not opened.
when clicking an ods file in Files pane, LibreOffice Calc does not launch and the file is not opened.
In the previous version 2022.07.2-576 (Spotted Wakerobin), all of these files (PDF/xlsx/ods) are opened as expected.
changed the title [-]PDF (and xlsx/ods) files cannot be opened from Files pane uncer certain conditions[/-][+]PDF (and xlsx/ods) files cannot be opened from Files pane under certain conditions[/+]on Dec 20, 2022
@k1-ito Thank you for raising this! We've run into issues with non-ASCII characters in the past. In this case, do the .Rmd file open, or do they fail to open, as well?
@ronblum Thank you for your response. I can open all the four Rmd files in the example above by clicking them in Files pane. (London.Rmd, München.Rmd, SãoPaulo.Rmd, 東京.Rmd)
The contents are shown in Source pane with no problem.
changed the title [-]PDF (and xlsx/ods) files cannot be opened from Files pane under certain conditions[/-][+]PDF (and xlsx/ods) files cannot be opened from Files pane when their filenames/paths include non-ASCII characters[/+]on Feb 9, 2023
I've found that the electron version of 2022.07.2+576 has the same problems as 2022.12.0+353 and the later ones (the Qt version of 2022.07.2+576 works fine).
Note that the workaround we added requires short path names to be enabled on the filesystem. @k1-ito, can you share the output of:
shortPathName("東京.pdf")
In this scenario, I see:
> shortPathName("東京.pdf")
[1] "7CA8~1.PDF"
In addition, you could also check from a Windows Command Prompt (need to start as administrator)
C:\Windows\System32>fsutil 8dot3name query C:
The volume state is: 0 (8dot3 name creation is ENABLED)
The registry state is: 2 (Per volume setting - the default)
Based on the above settings, 8dot3 name creation is ENABLED on "C:"
Thank you for your explanation.
The files were saved in a drive in which the 8.3 filename creation is disabled.
I tried your command in the C drive, where the 8.3 filename creation is enabled.
But again, 東京.pdf did not open.
I also tried to open other files.
The result is: successMünchen.xlsxSãoPaulo.xlsx failMünchen.pdfSãoPaulo.pdf東京.pdf東京.xlsx
With regard to the short filename, I have found that the 8.3 rule in my environment seems different from yours, and that all the "failed" files have short filenames with non-ASCII characters.
Thank you, that is very interesting -- perhaps it depends on the default system language or locale?
To resolve this, we would likely need to implement our own file opening utility, since we're effectively working around a bug in Electron itself. We'll try to see if there's some straightforward way to accomplish this.
Activity
[-]PDF (and xlsx/ods) files cannot be opened from Files pane uncer certain conditions[/-][+]PDF (and xlsx/ods) files cannot be opened from Files pane under certain conditions[/+]ronblum commentedon Dec 20, 2022
@k1-ito Thank you for raising this! We've run into issues with non-ASCII characters in the past. In this case, do the .Rmd file open, or do they fail to open, as well?
k1-ito commentedon Dec 20, 2022
@ronblum Thank you for your response. I can open all the four Rmd files in the example above by clicking them in Files pane. (
London.Rmd,München.Rmd,SãoPaulo.Rmd,東京.Rmd)The contents are shown in Source pane with no problem.
[-]PDF (and xlsx/ods) files cannot be opened from Files pane under certain conditions[/-][+]PDF (and xlsx/ods) files cannot be opened from Files pane when their filenames/paths include non-ASCII characters[/+]k1-ito commentedon Mar 17, 2023
The situation looks the same in RStudio-2023.03.0+386.
k1-ito commentedon Apr 22, 2023
@ronblum I have updated R to 4.3.0. The situation looks the same.
Additional information
Fonts of Japanese characters are sans-serif in 2022.07.2+576 and the earlier versions, while they are serif in 2022.12.0+353 and the later ones.
RStudio-2022.07.2+576 (sans-serif)

RStudio-2023.03.0+386 (serif)

k1-ito commentedon Apr 23, 2023
I've found that the electron version of 2022.07.2+576 has the same problems as 2022.12.0+353 and the later ones (the Qt version of 2022.07.2+576 works fine).
gtritchie commentedon Apr 23, 2023
Yes, this is a path handling bug in RStudio (Electron) so any version 2022.12 or newer has this problem. Should be an easy fix, I'll take a look.
16 remaining items
k1-ito commentedon Nov 8, 2023
Unfortunately, under my environment, it seems the problems remain. The files in question do not open.
Rstudio: 2023.12.0-dayly+262
R: 4.3.2 "Eye Holes"
Windows: 11 Pro 22H2 build 22621.2428
I tried both the installer-less and the exe versions of the daily build.
jonvanausdeln commentedon Nov 8, 2023
@k1-ito , what filename is failing for you?
k1-ito commentedon Nov 8, 2023
The filenames include:
München.pdf,SãoPaulo.pdf,東京.pdf,München.xlsx,SãoPaulo.xlsx,東京.xlsx.kevinushey commentedon Nov 8, 2023
It does work for me... here's the command I used to test:
Then, try to open the PDF from the files pane.
Note that the workaround we added requires short path names to be enabled on the filesystem. @k1-ito, can you share the output of:
In this scenario, I see:
In addition, you could also check from a Windows Command Prompt (need to start as administrator)
Replace
C:with the drive that your PDFs are on.k1-ito commentedon Nov 9, 2023
Thank you for your explanation.
The files were saved in a drive in which the 8.3 filename creation is disabled.
I tried your command in the C drive, where the 8.3 filename creation is enabled.
But again,
東京.pdfdid not open.I also tried to open other files.
The result is:
success
München.xlsxSãoPaulo.xlsxfail
München.pdfSãoPaulo.pdf東京.pdf東京.xlsxWith regard to the short filename, I have found that the 8.3 rule in my environment seems different from yours, and that all the "failed" files have short filenames with non-ASCII characters.

kevinushey commentedon Nov 9, 2023
Thank you, that is very interesting -- perhaps it depends on the default system language or locale?
To resolve this, we would likely need to implement our own file opening utility, since we're effectively working around a bug in Electron itself. We'll try to see if there's some straightforward way to accomplish this.
kevinushey commentedon Nov 17, 2023
I think this may have also been resolved by #13926.
jonvanausdeln commentedon Nov 17, 2023
@k1-ito , can you try with our latest daily build ? 2023.12.0-daily+306
I was able to open the files without issue.
k1-ito commentedon Nov 17, 2023
Thank you so much! I could also open the files with this build.
kevinushey commentedon Nov 18, 2023
Great! Thanks for taking the time to confirm.
Use the more specific shell.openPath() on Windows (#10040)
Use the more specific shell.openPath() on Windows (#10040)