rstudio / rstudioapi

Safely access RStudio's API (when available)
http://rstudio.github.io/rstudioapi
Other
165 stars 35 forks source link

documentPath don't mark Encoding #257

Closed tentacles-from-outer-space closed 1 year ago

tentacles-from-outer-space commented 1 year ago

When I use documenthPath on path with local characters the output is not marked as UTF8:

rstudioapi::documentPath()
# [1] "~/Ä…Ä…Ä…/test.R"
Encoding(rstudioapi::documentPath())
# [1] "unknown"
`Encoding<-`(rstudioapi::documentPath(), "UTF-8")
# [1] "~/ąąą/test.R"

I'm on Windows, local codepage 1250 (Polish_Poland), RStudio default encoding is UTF-8.