0

When I create an R-package using UTF-8 encoding and special characters like ä,ß, etc., they are shown correctly in the description, but if the title of a function contains one, the whole title becomes NA.

For example, I create the package minimalExample with

library(devtools)
library(roxygen2)

create("minimalExample")

Then I put the file with this function and description in the R folder of minimalExample:

#' Title containing ä or ß
#' 
#' Description containing ä or ß and ü.
#' 
#' @param x Some name.
#' @examples 
#' hello("world")
#' @encoding UTF-8

hello <- function(x){
  print(paste("Hello,", x))
}

Then I make the documentation pdf using

document("minimalExample")
shell('R CMD Rd2pdf --encoding=UTF-8 minimalExample')

And the result is: ä,ß and ü are in the description of the pdf manual file, but there's a NA instead of the title.

The help (at least using RStudio) displays the title correctly.

load_all("minimalExample")
?hello
tover
  • 535
  • 4
  • 11
  • Does this give you any other ideas? http://stackoverflow.com/questions/22223431/using-non-ascii-characters-inside-functions-for-packages – IRTFM Mar 27 '15 at 18:41
  • If I understood this correctly, the \u00A3 like escapes only work inside the function code. The only place where I run into this problem is in the title line, where it wouldn't create a pdf at all when I tried to insert the escape from above. – tover Mar 27 '15 at 21:16

0 Answers0