accented charatchers in a package manual
On 14/11/2012 15:24, Duncan Murdoch wrote:
On 14/11/2012 9:22 AM, Denis Talbot wrote:
Dear list, I am writing an R package manual and there is still a warning when I run "R CMD check" about "NON-ASCII contents without declared encoding". I do get the warning comes from an accent in the name of one of the author (Genevi?ve), but I can't find what I am supposed to do about it. I know there is a section about encoding in the "Writing R extension" manual, but I couldn't understand what I should do from reading it. Any help is welcomed.
You need to declare what encoding you are using. Put a line in your DESCRIPTION file like Encoding: utf-8 If you don't know what encoding you are using, you can probably find out by reading the docs for your text editor, or just guess: If you are on Windows it is likely latin1, on Linux it is likely utf-8. If you guess wrong you'll get errors or ugly text when R produces the manual.
But note the manual says
'Only encoding names latin1, latin2 and UTF-8 are known to be portable.'
'utf-8' is never correct and may or may not be accepted.
The error message 'Non-ASCII contents without declared encoding' (sic)
occurs in processing Rd files. So you would probably do better to add a
\encoding{} line to the Rd file where the name occurs. There are many
examples in the R sources, e.g. src/library/graphics/man/text.Rd .
Duncan Murdoch
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595