-1
I’m having trouble accessing files from a compressed folder. The filenames contain accents, but when unzipping the names are changed according to the configuration of each computer that opens and executes the code. Is there any way to keep the encoded file name when unzipping or to be able to access the files from that folder? I need to do everything via R code (version 4.0.2) in windows 10. By running the following code:
dir.create("./federal_highway")
setwd("./federal_highway/")
temp <- tempfile()
download.file(URLencode("https://servicos.dnit.gov.br/dnitcloud/index.php/s/oTpPRmYs5AAdiNr/download"), destfile = "./original/Repositorio.zip", method="auto", mode="wb")
unzip("./original/Repositorio.zip")
zipfiles <- list.files(path = "./Repositório/SNV Bases Geométricas (2013-Atual) (SHP)", full.names = T, pattern = "*.zip")
It runs smoothly but I get the following message:
Warning message:
In list.files(path = "./Repositório/SNV Bases GeomÃ<U+0083>©tricas (2013-Atual) (SHP)", :
unable to translate './Repositório/SNV Bases GeomÃ<U+0083>©tricas (2013-Atual) (SHP)' to native encoding
And zipfiles returns "Character(0)"