Two fixes in install.r
- add
useBytes=T
forgsub()
inhtmlize()
- within
.writePkgIndices()
, addencoding='UTF-8'
tooutcon
Domanda
I am making a R package of my own. However, I am having encoding problems with package help.
For the record, I need to write package help in Chinese. I write .Rd
file with the following additional setup according to the document of writing R extention:
\encoding{utf-8}
to the first line of each .Rd
file.Rd
file as utf-8 encoded without BOMAnd here are the results:
+ the CJK characters in the description
section are correctly recognized in the help window of RStudio.
+ R compiler fails if there are CJK characters in the title
section with the following message:
*** installing help indices
Error in gsub("&", "&", x, fixed = TRUE) :
invalid multibyte string at '<84> <74>op k €'
I believe international documents for R are necessary. Are there anyone has experience on this?
Soluzione
Two fixes in install.r
useBytes=T
for gsub()
in htmlize()
.writePkgIndices()
, add encoding='UTF-8'
to outcon