[R-pkg-devel] ω, α, η, ² in .Rd files
Jonathon Love
jon at thon.cc
Sat Feb 11 01:35:53 CET 2017
hi duncan,
>> yup, although if the encoding of the comments in the .R files are
>> completely misunderstood by system, it shouldn't make any difference to
>> the resultant package. Or is there a way that it could interfere?
>
> Roxygen2 will take the comments and write out .Rd files. Those files
> need to be written in ASCII, or the declared encoding of the package,
> not of the locale where Roxygen2 was run. (R and CRAN know nothing
> about Roxygen2, they just look at the Rd files as though they were
> written by you.)
>
> So I think it should be possible for all of this to work: If you
> write your comments in UTF-8 and declare that as the encoding of the
> package, then Roxygen2 should read the .R files as UTF-8 files, and
> write out UTF-8 Rd files, regardless of the locale. But encodings of
> strings go through several translations internally in R, so there may
> be some step there that loses the original intent. And Roxygen2 may
> be just ignoring encodings, which would almost certainly go badly.
yup, this all works as you describe. the only wrinkle is that the CRAN
checks on windows don't like non-ascii characters appearing in the .R
files (which they would if one puts special chars in one's roxygen
annotations).
cheers
jonathon
More information about the R-package-devel
mailing list