Skip to content
Prev 58689 / 63424 Next

Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3?

Dear Juan,

I don't see what is the problem from your report. Please try to create a 
minimal but complete reproducible example that does not use the renv 
package. Perhaps you could use the R debugger (e.g. via 
options(error=recover)) to find out what is the argument that 
file.exists() has been called with. And then you could try just to call 
file.exists() directly with that argument to trigger the problem.

It may be that the argument has been corrupted/is invalid in the current 
native encoding. If that is the case, the next step would be to find out 
who corrupted it (renv, R, something else). The error is displayed when 
a path name cannot be converted from the current native encoding to 
UTF16-LE.

The experimental support for UTF-8 as native encoding on Windows 10 is 
only available in a custom build of R, like the one I linked from my 
blog post.

Thanks
Tomas
On 6/10/20 1:06 PM, Juan Telleria Ruiz de Aguirre wrote:

Thread (13 messages)

Juan Telleria Ruiz de Aguirre Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3? Jun 10 Tomas Kalibera Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3? Jun 10 Dirk Eddelbuettel Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3? Jun 10 Kevin Ushey Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3? Jun 10 Juan Telleria Ruiz de Aguirre Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3? Jun 10 Yihui Xie Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3? Jun 21 Tomas Kalibera Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3? Jun 22 Yihui Xie Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3? Jun 23 Johannes Rauh `basename` and `dirname` change the encoding to "UTF-8" Jun 29 Duncan Murdoch `basename` and `dirname` change the encoding to "UTF-8" Jun 29 Kevin Ushey `basename` and `dirname` change the encoding to "UTF-8" Jun 29 Tomas Kalibera `basename` and `dirname` change the encoding to "UTF-8" Jun 30 Johannes Rauh `basename` and `dirname` change the encoding to "UTF-8" Jun 30