Thanks for the quick response both Duncan and Gábor.  I've reported it here in 
case others want to follow-up there: 
https://github.com/r-lib/roxygen2/issues/1121

-----Original Message-----
From: Gábor Csárdi <csardi.ga...@gmail.com> 
Sent: Thursday, July 23, 2020 5:25 PM
To: Duncan Murdoch <murdoch.dun...@gmail.com>
Cc: b...@denney.ws; R Package Devel <r-package-devel@r-project.org>
Subject: Re: [R-pkg-devel] Check Error Due to Unicode in Documentation

On Thu, Jul 23, 2020 at 9:58 PM Duncan Murdoch <murdoch.dun...@gmail.com> wrote:
>
> On 23/07/2020 4:14 p.m., b...@denney.ws wrote:
[...]
>
> If you change the source to include the explicit characters (i.e. use 
> pattern = c("μ", "µ") instead of pattern=c("\u03bc", "\u00b5")), does 
> that help?
>
> It may cause other issues:  WRE recommends against including UTF-8 
> chars in source code.
>
> If that doesn't solve the problem, then it looks like an issue with 
> Roxygen2.  I don't know if there's a way to tell it not to convert \u 
> escapes into the corresponding character.  If there isn't, it seems 
> like that's something they should add.  As a workaround, is there a 
> way to say that this one particular .Rd file should be edited by hand, 
> instead of auto-generated?

I don't think roxygen2 intentionally converts \u sequences, I think this is 
just a consequence of the parse() + deparse() roundtrip:

x <- '"\\u03bc"'
charToRaw(x)
#>  [1] 22 5c 75 30 33 62 63 22
y <- deparse(eval(parse(text = x)))
charToRaw(y)
#> [1] 22 b5 22

Bill, please report a roxygen2 issue at
https://github.com/r-lib/roxygen2/issues and we can probably fix this.
Thanks!

Gabor

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

Reply via email to