3

I have 3000 files saved as Persian characters for example, "فایل ۱.xlsx". When I try to open these files (using Openxlsx package), I got following error:

 library(openxlsx)
 > file_temp<-file.choose()
 > parameters_old<-read.xlsx(file_temp,sheet = "parameters")
 Error in unzip(xlsxFile, exdir = xmlDir) : 
 unable to translate 'D:\allfiles\<U+0627><U+0631><U+062F><U+0628><U+06CC><U+0644>.xlsx' to                     
 native encoding

Is there any method to open the files?

zx8754
  • 52,746
  • 12
  • 114
  • 209
Masoud
  • 535
  • 3
  • 19
  • Related, possible duplicate of: https://stackoverflow.com/q/24354375/680068 – zx8754 Jun 08 '21 at 11:53
  • If you don't want to change your locale, you might be able to solve this issue with `gzcon` as described here: https://stackoverflow.com/a/69400973/8436923 Another possibility is, `readBin` should be able to read a file whose name is encoded in UTF-8; then save it to a (temporary) file with an ASCII name that can be read by openxlsx. – Montgomery Clift Oct 03 '21 at 04:59

0 Answers0