fs
fs copied to clipboard
`path_real()` garbles non-ascii characters in non-UTF-8 locale
Very similar to #366
On Windows with 4.1.2.
Discovered while starting to poke around https://github.com/r-lib/devtools/issues/2422. All package/project paths are pre-processed with fs::path_real()
in usethis, so this bug is quite painful.
library(fs)
dir_create("f\u00F6\u00F6")
(x <- list.files(pattern = "^f"))
#> [1] "föö"
path_abs(x)
#> C:/Users/jenny/AppData/Local/Temp/RtmpyQS9MB/reprex-88c664c3346-vain-paca/föö
path_real(x)
#> C:/Users/jenny/AppData/Local/Temp/RtmpyQS9MB/reprex-88c664c3346-vain-paca/föö
Created on 2022-05-17 by the reprex package (v2.0.1)
devtools::as.package()
also processes every path through path_real()
, so again, pretty painful on Windows + R < 4.2.
Coming back from devtools#2422, the issue also persists with R 4.2 for me