Message-ID: <030101d66139$b9854f40$2c8fedc0$@denney.ws>
Date: 2020-07-23T21:39:20Z
From: biii m@iii@g oii de@@ey@ws
Subject: [R-pkg-devel] Check Error Due to Unicode in Documentation
In-Reply-To: <CABtg=K=P=Wh2vtOTMumemrh82TECONMw-DoSen41Upy+oUrGNQ@mail.gmail.com>
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.gabor at gmail.com>
Sent: Thursday, July 23, 2020 5:25 PM
To: Duncan Murdoch <murdoch.duncan at gmail.com>
Cc: bill at denney.ws; R Package Devel <r-package-devel at 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.duncan at gmail.com> wrote:
>
> On 23/07/2020 4:14 p.m., bill at 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