[Rd] R-4.3 version list.files function could not work correctly in chinese

yu gong yugong @end|ng |rom out|ook@com
Sun Aug 13 11:28:19 CEST 2023


I am afraid this issue a bite more complicated.
Test Rgui and Rterm 4.3.1 and svn trunk on Windows 10 x64 (build 19044) , Chinese file name shows correctly (file content ANSI or UTF-8 ).
I saw OP picture (using Rstudio), maybe this is Rstudio issues?





________________________________
From: R-devel <r-devel-bounces using r-project.org> on behalf of Yihui Xie <xie using yihui.name>
Sent: Saturday, August 12, 2023 12:40
To: Ivan Krylov <krylov.r00t using gmail.com>
Cc: r-devel using r-project.org <r-devel using r-project.org>; 叶月光 <yeyueguang using goldwind.com>
Subject: Re: [Rd] R-4.3 version list.files function could not work correctly in chinese

Yes, I participated in the discussion. Basically dir() failed to list all
files since R 4.3.0 when filenames start with Chinese characters. I don't
have a Windows machine to test it, but this might be a minimal reproducible
example:

file.create("常用代码.R")
dir()

The OP said dir() would return "常用代码.R" in R.4.2.2 but not in R 4.3.0. In
the same discussion another person mentioned that the problem could also be
related to the file encoding, i.e., if the file content is encoded in
UTF-8, it could be recognized by dir(), but not in ANSI.

Regards,
Yihui
--
https://yihui.org


On Fri, Aug 11, 2023 at 6:25 AM Ivan Krylov <krylov.r00t using gmail.com> wrote:

> Dear 叶月光,
>
> Thank you for your message, but please follow the posting guide in your
> future messages: https://www.r-project.org/posting-guide.html
> https://www.r-project.org/bugs.html
>
> I understand from your link that list.files() ends up skipping some
> Chinese filenames in R-4.3.1 (but not R-4.2.2) on Windows, but would you
> (or perhaps Yihui Xie who I see is also participating in the discussion)
> mind translating the rest of your findings into English? Have you been
> able to narrow down the problem to certain character ranges, for
> example?
>
> --
> Best regards,
> Ivan
>
> ______________________________________________
> R-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

        [[alternative HTML version deleted]]

______________________________________________
R-devel using r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

	[[alternative HTML version deleted]]



More information about the R-devel mailing list