Re: [R-pkg-devel] Windows R 4.2.0 package will not load with UTF-8 encoding

2022-06-11 Thread Duncan Murdoch

On 11/06/2022 6:43 a.m., Joseph Park wrote:

Thank you for the check of the CRAN builds.  I also checked that as a first
step.  Perhaps there is some difference between the CRAN setups, as I have
reproduced this on 3 Windows 10 machines with clean installs of R 4.2.0,
and it has been reported by other users.  I also noted in the post that
building and installing via devtools reports success (  ** testing if
installed package can be loaded from temporary location ), however, a
subsequent attempt to load hangs.


One possible difference is the version of Windows 10.  The UTF8 handling 
was described in the NEWS file this way:


"R uses UTF-8 as the native encoding on recent Windows systems (at least 
Windows 10 version 1903, Windows Server 2022 or Windows Server 1903). As 
a part of this change, R uses UCRT as the C runtime. UCRT should be 
installed manually on systems older than Windows 10 or Windows Server 
2016 before installing R."


Conceivably the systems where this fails don't have the new UCRT 
runtime.  I believe running Windows Update should get it.


If it doesn't, or for users on an older Windows version, this page lets 
you download it: 
https://www.microsoft.com/en-us/download/details.aspx?id=48234 .



Duncan Murdoch



On Sat, Jun 11, 2022 at 6:33 AM Joseph Park  wrote:


Apologies for the pages of minutia.  I endeavored to post reproduceable
example. I'm unable to show the failure since it simply hangs at the prompt
with CPU spinning and memory cyclically ramping and declining.  One has to
kill R. The posted commands show the workaround, not the failure.

I since found that just changing the LC_COLLATE is enough to allow the
library to load :

Sys.setlocale('LC_COLLATE','English')

[1] "English_United States.1252"

Sys.getlocale()

[1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.utf8;LC_MONETARY=English_United
States.utf8;LC_NUMERIC=C;LC_TIME=English_United States.utf8"

Again, apologies for my naivety.

On Sat, Jun 11, 2022 at 6:16 AM Duncan Murdoch 
wrote:


On 11/06/2022 5:02 a.m., Joseph Park wrote:

Dear R package developers,

Starting with R 4.2.0 package rEDM (

https://cran.r-project.org/package=rEDM)

will not load [library( rEDM )] on Windows with the default UTF-8

encoding.


When the locale is changed from UTF-8 to non UTF-8, the package loads

and

runs. One can also change the locale to non-UTF-8, load the package,

detach

and unload the package, change the locale back to UTF-8, then load and

run

without issue.

Note that installation from source reports:
 ** testing if installed package can be loaded from temporary

location

and completes (record below).

This package uses Rcpp to wrap a C++ API.

Having searched here and in general, I don't find that others

experiencing

this issue.

I have tried
Ensure all source files are UTF-8 encoded
Removed non-ASCII characters from all source files
Specify non-ASCII characters with \u
Checked vignette encoding
Added "Encoding : UTF-8" to DESCRIPTION

Please excuse my encoding and Windows naivety.

Here is a demonstration changing the encoding to load the package, along
with unloading & reloading under UTF-8:
--

sessionInfo()

R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United
States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C

[5] LC_TIME=English_United States.utf8

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.2.0


Sys.setlocale('LC_ALL','English')

[1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"
Warning message:
In Sys.setlocale("LC_ALL", "English") :
using locale code page other than 65001 ("UTF-8") may cause problems


sessionInfo()

R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C

[5] LC_TIME=English_United States.1252
system code page: 65001

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.2.0


library( rEDM )

sessionInfo()

R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C

[5] LC_TIME=English_United States.1252
system code page: 65001

attached base packages:
[1] stats graphic

Re: [R-pkg-devel] a problem with the underscore in a R function document

2022-06-11 Thread Martin Maechler
> Yaoyong Li 
> on Sat, 11 Jun 2022 12:29:25 +0100 writes:

> Hello,

> I just got a problem in a function document in a package I developed.The
> file containing the document is generatingCDSaaFile.Rd. The problem is
> related to the underscore I used in the following sentence

> and the last part is ‘\_AAseq.txt.gz’

> I got a 'note' message when the package was checked in the CRAN:

> checkRd: (-1) generatingCDSaaFile.Rd:72: Escaped LaTeX specials: \_

> I don't think I saw this kind of message in the past (say six months
> ago). 

Yes, you are right.. this is quite new.  Some of my
/man/*.Rd  files have been affected similarly.

AFAIK there is a history behind, where the   Rd -> LaTeX
translation code was partly buggy  for quite a long time, and hence
such  `\`-escapes where necessary in *.Rd such that the produced
*.tex was LaTeX-able.

However, these Rd2latex bugs/problems have been fixed and now
almost all such \-escapes are not only unneeded but actually the
`\` become visible, hence ugly looking
==> hence the NOTE.

> A copy of the check result in CRAN is appended below. As you can
> see, I also got the same problem in other places in the document. I
> have been trying to fix the problem via searching Google. I have tried
> to replace "\_" with "\textunderscore " as some internet post
> suggested, but this did not solve the problem.

> So I just wonder if anyone can help me with the problem. Please let me
> know if any more information is needed.

In all cases in my packages,  just removing the `\` (or
sometimes `\\` ?)  was perfect, so I think you can and should do
just that.

Best,
Martin


> Best regards,

> Yaoyong

> #

> CRAN Package Check Results for Package geno2proteo
> 

> Last updated on 2022-06-11 11:52:26 CEST.
> FlavorVersionTinstallTcheckTtotalStatusFlags
> r-devel-linux-x86_64-debian-clang
> 

> 0.0.5 17.31 170.54 187.85 NOTE
> 

> r-devel-linux-x86_64-debian-gcc
> 

> 0.0.5 12.00 130.58 142.58 NOTE
> 

> r-devel-linux-x86_64-fedora-clang
> 

> 0.0.5 220.04 NOTE
> 

> r-devel-linux-x86_64-fedora-gcc
> 

> 0.0.5 229.54 NOTE
> 

> r-devel-windows-x86_64
> 

> 0.0.5 242.00 470.00 712.00 NOTE
> 

> r-patched-linux-x86_64
> 

> 0.0.5 12.58 164.99 177.57 OK
> 

> r-release-linux-x86_64
> 

> 0.0.5 OK
> 

> r-release-macos-arm64
> 

> 0.0.5 65.00 OK
> 

> r-release-macos-x86_64
> 

> 0.0.5 89.00 OK
> 

> r-release-windows-x86_64
> 

> 0.0.5 195.00 363.00 558.00 OK
> 

> r-oldrel-macos-arm64
> 

> 0.0.5 57.00 OK
> 

> r-oldrel-macos-x86_64
> 

> 0.0.5 84.00 OK
> 


[R-pkg-devel] a problem with the underscore in a R function document

2022-06-11 Thread Yaoyong Li
Hello,

I just got a problem in a function document in a package I developed.The
file containing the document is generatingCDSaaFile.Rd. The problem is
related to the underscore I used in the following sentence

  and the last part is ‘\_AAseq.txt.gz’

I got a 'note' message when the package was checked in the CRAN:

checkRd: (-1) generatingCDSaaFile.Rd:72: Escaped LaTeX specials: \_

I don't think I saw this kind of message in the past (say six months
ago). A copy of the check result in CRAN is appended below. As you can
see, I also got the same problem in other places in the document. I
have been trying to fix the problem via searching Google. I have tried
to replace "\_" with "\textunderscore " as some internet post
suggested, but this did not solve the problem.

So I just wonder if anyone can help me with the problem. Please let me
know if any more information is needed.


Best regards,

Yaoyong

#

CRAN Package Check Results for Package geno2proteo


Last updated on 2022-06-11 11:52:26 CEST.
FlavorVersionTinstallTcheckTtotalStatusFlags
r-devel-linux-x86_64-debian-clang

0.0.5 17.31 170.54 187.85 NOTE

r-devel-linux-x86_64-debian-gcc

0.0.5 12.00 130.58 142.58 NOTE

r-devel-linux-x86_64-fedora-clang

0.0.5 220.04 NOTE

r-devel-linux-x86_64-fedora-gcc

0.0.5 229.54 NOTE

r-devel-windows-x86_64

0.0.5 242.00 470.00 712.00 NOTE

r-patched-linux-x86_64

0.0.5 12.58 164.99 177.57 OK

r-release-linux-x86_64

0.0.5 OK

r-release-macos-arm64

0.0.5 65.00 OK

r-release-macos-x86_64

0.0.5 89.00 OK

r-release-windows-x86_64

0.0.5 195.00 363.00 558.00 OK

r-oldrel-macos-arm64

0.0.5 57.00 OK

r-oldrel-macos-x86_64

0.0.5 84.00 OK

r-oldrel-windows-ix86+x86_64

0.0.5 32.00 145.00 177.00 OK

Check
Details

Version: 0.0.5
Check: Rd files
Result: NOTE
checkRd: (-1) generatingCDSaaFile.Rd:23: Escaped LaTeX specials: \_ \_
checkRd: (-1) generatingCDSaaFile.Rd:72: Escaped LaTeX specials: \_

Flavors: r-devel-linux-x86_64-debian-clang
,
r-devel-linux-x86_64-debian-gcc
,
r-devel-linux-x86_64-fedora-clang
,
r-devel-linux-x86_64-fedora-gcc
,
r-devel-windows-x86_64


##

Re: [R-pkg-devel] Windows R 4.2.0 package will not load with UTF-8 encoding

2022-06-11 Thread Joseph Park
Thank you for the check of the CRAN builds.  I also checked that as a first
step.  Perhaps there is some difference between the CRAN setups, as I have
reproduced this on 3 Windows 10 machines with clean installs of R 4.2.0,
and it has been reported by other users.  I also noted in the post that
building and installing via devtools reports success (  ** testing if
installed package can be loaded from temporary location ), however, a
subsequent attempt to load hangs.

On Sat, Jun 11, 2022 at 6:33 AM Joseph Park  wrote:

> Apologies for the pages of minutia.  I endeavored to post reproduceable
> example. I'm unable to show the failure since it simply hangs at the prompt
> with CPU spinning and memory cyclically ramping and declining.  One has to
> kill R. The posted commands show the workaround, not the failure.
>
> I since found that just changing the LC_COLLATE is enough to allow the
> library to load :
> > Sys.setlocale('LC_COLLATE','English')
> [1] "English_United States.1252"
> > Sys.getlocale()
> [1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> States.utf8;LC_MONETARY=English_United
> States.utf8;LC_NUMERIC=C;LC_TIME=English_United States.utf8"
>
> Again, apologies for my naivety.
>
> On Sat, Jun 11, 2022 at 6:16 AM Duncan Murdoch 
> wrote:
>
>> On 11/06/2022 5:02 a.m., Joseph Park wrote:
>> > Dear R package developers,
>> >
>> > Starting with R 4.2.0 package rEDM (
>> https://cran.r-project.org/package=rEDM)
>> > will not load [library( rEDM )] on Windows with the default UTF-8
>> encoding.
>> >
>> > When the locale is changed from UTF-8 to non UTF-8, the package loads
>> and
>> > runs. One can also change the locale to non-UTF-8, load the package,
>> detach
>> > and unload the package, change the locale back to UTF-8, then load and
>> run
>> > without issue.
>> >
>> > Note that installation from source reports:
>> > ** testing if installed package can be loaded from temporary
>> location
>> > and completes (record below).
>> >
>> > This package uses Rcpp to wrap a C++ API.
>> >
>> > Having searched here and in general, I don't find that others
>> experiencing
>> > this issue.
>> >
>> > I have tried
>> >Ensure all source files are UTF-8 encoded
>> >Removed non-ASCII characters from all source files
>> >Specify non-ASCII characters with \u
>> >Checked vignette encoding
>> >Added "Encoding : UTF-8" to DESCRIPTION
>> >
>> > Please excuse my encoding and Windows naivety.
>> >
>> > Here is a demonstration changing the encoding to load the package, along
>> > with unloading & reloading under UTF-8:
>> > --
>> >> sessionInfo()
>> > R version 4.2.0 (2022-04-22 ucrt)
>> > Platform: x86_64-w64-mingw32/x64 (64-bit)
>> > Running under: Windows 10 x64 (build 19044)
>> >
>> > Matrix products: default
>> >
>> > locale:
>> > [1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United
>> > States.utf8
>> > [3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
>> >
>> > [5] LC_TIME=English_United States.utf8
>> >
>> > attached base packages:
>> > [1] stats graphics  grDevices utils datasets  methods   base
>> >
>> > loaded via a namespace (and not attached):
>> > [1] compiler_4.2.0
>> >>
>> >> Sys.setlocale('LC_ALL','English')
>> > [1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
>> > States.1252;LC_MONETARY=English_United
>> > States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"
>> > Warning message:
>> > In Sys.setlocale("LC_ALL", "English") :
>> >using locale code page other than 65001 ("UTF-8") may cause problems
>> >>
>> >> sessionInfo()
>> > R version 4.2.0 (2022-04-22 ucrt)
>> > Platform: x86_64-w64-mingw32/x64 (64-bit)
>> > Running under: Windows 10 x64 (build 19044)
>> >
>> > Matrix products: default
>> >
>> > locale:
>> > [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
>> > States.1252
>> > [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
>> >
>> > [5] LC_TIME=English_United States.1252
>> > system code page: 65001
>> >
>> > attached base packages:
>> > [1] stats graphics  grDevices utils datasets  methods   base
>> >
>> > loaded via a namespace (and not attached):
>> > [1] compiler_4.2.0
>> >>
>> >> library( rEDM )
>> >>
>> >> sessionInfo()
>> > R version 4.2.0 (2022-04-22 ucrt)
>> > Platform: x86_64-w64-mingw32/x64 (64-bit)
>> > Running under: Windows 10 x64 (build 19044)
>> >
>> > Matrix products: default
>> >
>> > locale:
>> > [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
>> > States.1252
>> > [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
>> >
>> > [5] LC_TIME=English_United States.1252
>> > system code page: 65001
>> >
>> > attached base packages:
>> > [1] stats graphics  grDevices utils datasets  methods   base
>> >
>> > other attached packages:
>> > [1] rEDM_1.12.2.1.0
>> >
>> > loaded via a namespace (and not attached):
>> > [1] compiler_4.2.0 Rcpp_1.0.8.3
>> >>
>> >
>> > ### All package tests pass
>> > ### Now detach and unload, cha