From tom@@@k@||ber@ @end|ng |rom gm@||@com  Wed Sep  8 17:48:20 2021
From: tom@@@k@||ber@ @end|ng |rom gm@||@com (Tomas Kalibera)
Date: Wed, 8 Sep 2021 17:48:20 +0200
Subject: [Rd] Detect UCRT-built R from within R sessions (and in
 configure.win)
In-Reply-To: <CALyqOb8r7ajAumf5V0+YJk83X091NS2eRCs-cu=X6zO+09z0Rg@mail.gmail.com>
References: <CALyqOb8r7ajAumf5V0+YJk83X091NS2eRCs-cu=X6zO+09z0Rg@mail.gmail.com>
Message-ID: <a219a307-5200-a13e-b4d9-a1e7a646e137@gmail.com>


On 9/8/21 2:08 PM, Hiroaki Yutani wrote:
> Hi,
>
> Are there any proper ways to know whether the session is running on
> the R that is built with the UCRT toolchain or not? Checking if the
> encoding is UTF-8 might do the trick, but I'm not sure if it's always
> reliable.

There in not such a mechanism, yet, but can be added, at least for 
diagnostics.

You are right that checking for UTF-8 encoding would not always be 
reliable. For example, the version of Windows may be too old to allow R 
use UTF-8 as native encoding (e.g. Windows server 2016), then R will use 
the native code page as it does today in the MSVCRT builds.

> Also, I'd like to know if there's any mechanism to detect the UCRT in
> configure.win. I know there are Makevars.ucrt and Makefile.ucrt, but
> one might want to do some feature test that is specific to the UCRT
> toolchain.

We could add support for configure.ucrt, which would take precedence 
over configure.win on the UCRT builds (like Makevars.ucrt takes 
precedence over Makevars.win). Would that work for you?

Best
Tomas

>
> Best,
> Hiroaki Yutani
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Detect UCRT-built R from within R sessions (and in configure.win)
Tomas Kalibera