Local configuration tu UTF-8 or any that reads accents

59 Views Asked by At

Have been trying to load an Excel file that is inside a folder that contains an accent but have not been able to do it.

Thorugh the normal process, I get the following Error:

ent \<- "2. En proceso/IPP 120-01-2022 Reglamento Ferroviario/Datos/" 

df \<- read_xls(paste0(ent, "Contratos2022_2203220927", ".xlsx"))

Error:    filepath: C:\\Users\\paulo\\OneDrive - El Colegio de México A.C\\2. Diputados\\1. Con impacto\\2. En proceso\\IPP 120-01-2022 Reglamento Ferroviario\\Datos\\Contratos2022_2203220927.xlsx   libxls error: Unable to open file

The problem seems to be in the word "México". Tried to solve the problem with

ent <- Sys.glob(paste0(getwd(), "/", "2. En proceso/IPP 120-01-2022 Reglamento Ferroviario/Datos/"))
df \<- read_xls(paste0(ent, "Contratos2022_2203220927", ".xlsx"))

But then I get the following message:

Error:    filepath: C:\Users\paulo\OneDrive - El Colegio de México A.C\2. Diputados\1. Con impacto\2. En proceso\IPP 120-01-2022 Reglamento Ferroviario\Datos\Contratos2022_2203220927.xlsx   libxls error: Unable to open file

Although the accent is fixed, the problem persists.

Have tried to run the code with different file encodings (Windows-1252 & UFT-8) but nothing works. My locale configuration is:

> Sys.getlocale()

> \[1\] "LC_COLLATE=Spanish_Mexico.1252;LC_CTYPE=Spanish_Mexico.1252;LC_MONETARY=Spanish_Mexico.1252;LC_NUMERIC=C;LC_TIME=Spanish_Mexico.1252"
0

There are 0 best solutions below