Re: path.expand fails on some windows platform
Ivan Krylov via R-help <[email protected]> Wed, 8 Jul 2026 21:21:14 +0300
| Newsgroups | gmane.comp.lang.r.general |
|---|---|
| Message-ID | <[email protected]> |
Dear Manuel Mu=C3=B1oz M=C3=A1rquez, 8 july 2026 18:32:07 GMT+03:00, "Manuel Mu=C3=B1oz M=C3=A1rquez" <[email protected]> wrote: >Dear all. > >When using R version 4.6.1 on certain Windows platforms where the >username contains non-ASCII characters (such as "=C3=A1"), the command: >path.expand("~") fails with the following error: >Error: file name conversion problem -- name too long? > >This occurs when the Windows OS does not define the R_USER environment >variable. In these cases, a call to Sys.getenv("R_USER") returns an >empty string (""). Yes, this is a bug: https://bugs.r-project.org/show_bug.cgi?id=3D18949 The encoding conversion function that should be returning UTF-8 is called too early in the process startup, so it converts the home directory path to the wrong encoding (ANSI). -- = Best regards, Ivan