Skip to content

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

@JantekM

Description

@JantekM

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorutf8 🌏

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions