Skip to content
New issue

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

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

Already on GitHub? # to your account

Not supporting UTF-8 characters in file paths when generating documentation #1277

Closed
JantekM opened this issue Jan 2, 2022 · 5 comments · Fixed by #1325
Closed

Not supporting UTF-8 characters in file paths when generating documentation #1277

JantekM opened this issue Jan 2, 2022 · 5 comments · Fixed by #1325
Labels
bug an unexpected problem or unintended behavior utf8 🌏
Milestone

Comments

@JantekM
Copy link

JantekM commented Jan 2, 2022

When making a custom template I noticed that after adding a custom format for the template I couldn't generate roxygen documentation with devtools::document() from RStudio which gave this error:

> devtools::document()
i Updating JantoTools documentation
Error: Failed to open G:\MĂłj dysk\Zdalne\Dokumenty zdalne\Statystyka\JantoTools/R/templates.R

Which, after some digging, led me to this piece of code throwing the error:
roxygen2::roxygenise("G:/Mój dysk/Zdalne/Dokumenty zdalne/Statystyka/JantoTools", NULL)

Note the change in the file path from G:/Mój dysk/... to G:\MĂłj dysk\...

Running the whole thing from another location with no ó in file path succeeded with no errors.

I tried (or checked if it is set) with no effect:

  • setting global default encoding to UTF-8
  • same with project settings
  • reopening the file with UTF-8 encoding
  • options(encoding = "UTF-8")
  • using Sys.setlocale()

The whole code is available here.

@kleinbub
Copy link

I have exactly the same issue (on windows 10). I'm forced by my institution to work in a path that has a "Università" with a unicode letter in the path. I used to be able to overcome this using symbolic links in older versions. But now I get
"Error: Failed to open C:\Users\Kleinbub\OneDrive - Università degli Studi di Padova" (note the conversion from UTF8 'à' to ANSI 'Ã' )
I have pinpointed the issue up to the update_collate() function. Indeed when I run roxygenize without the "collets" roclets it runs with no error.

@jacobmaugoust
Copy link

Hello,
Same issue here. It works fine with the 7.1.1 version but not with the 7.1.2 one; I changed absolutely nothing in the path or project enconding options. Had to roll back to the 7.1.1 version.
I tried to run the code of the roxygenize function; no particular errors, but at the end, the various lapply's on the blocks object lead to empty things, so maybe it's somewhere there...
Hope this issue will be solved, good luck with that!

@hadley
Copy link
Member

hadley commented Mar 29, 2022

Hmmmm, given that it works in 7.1.1 and not 7.1.2, the most likely cause would be the conversion from Rcpp to cpp11.

Could any of you give me a traceback() to confirm exactly where the error is coming from?

@hadley hadley added bug an unexpected problem or unintended behavior utf8 🌏 labels Mar 29, 2022
@hadley
Copy link
Member

hadley commented Mar 29, 2022

@kleinbub
Copy link

kleinbub commented Apr 6, 2022

Is this what you need @hadley?
It should be noted that the correct path would be ...Università... not ...UniversitÃ... as reported in the error.
Also, if relevant, this is a windows 10 system.

Error: Failed to open A:\OneDrive - Università degli Studi di Padova\rMEA development\rMEA/R/rMEA_IO.R 

9.
FUN(X[[i]], ...) 
8.
lapply(paths, find_includes) 
7.
generate_collate(file.path(base_path, "R")) 
6.
update_collate(base_path) 
5.
roxygen2::roxygenise(pkg$path, roclets) 
4.
devtools::document(roclets = c("rd", "collate", "namespace")) 
3.
.is.positive.intlike(x) 
2.
.traceback(x, max.lines = max.lines) 
1.
traceback({
    devtools::document(roclets = c("rd", "collate", "namespace"))
})

@hadley hadley added this to the v7.1.3 milestone Apr 6, 2022
hadley added a commit that referenced this issue Apr 8, 2022
hadley added a commit that referenced this issue Apr 12, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug an unexpected problem or unintended behavior utf8 🌏
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants