I'm using fs::dir_ls() to get excel file paths under a directory main_path, but since there are Chinese characters in the file paths, I get an unreadable output, I think it's maybe related to encoding issues:
main_path <- '../../raw_data/2022-01-10/'
file_paths <- fs::dir_ls(main_path, regexp = ".xlsx")
file_paths
Out:
../../raw_data/2022-01-10/閽㈤搧_鐒︾偔_浠峰樊_鐒︾偔J2201DCE鐒︾偔J2205DCE_涓诲姏_2022-01-10.xlsx
../../raw_data/2022-01-10/閽㈤搧_鐒︾偔_浠峰樊_鐒︾偔J2201DCE鐒︾偔J2209DCE_2022-01-10.xlsx
While list.files(path = main_path, pattern ='.xlsx') returns file names correctly:
[1] "甘其毛道库提价含税焦煤A23V2606SG85JM焦煤JM2201DCE_2022-01-10.xlsx"
[2] "甘其毛道库提价含税焦煤A23V2606SG85JM焦煤JM2205DCE_2022-01-10.xlsx"