How to knit2html with UTF-8 encoding?

My .Rmdfile contains multilingual text. When I load the html page created knit2htmlon my joomla website, the multilingual text is replaced by squares. Do you know a way to request an utf-8encoded html page or any other way to overcome this problem?

+5
source share
1 answer

Update:

RStudio (> = 0.97.x) and knitr (> = 1.2) know how to handle file encoding. RStudio passes the encoding of the file as an argument encoding knit()(for example, knit('foo.Rmd', encoding = 'UTF-8')). In short, updating RStudio and knitr will solve the problem.

Please ignore the answer below; this is no longer a suitable solution.


I did it like this (using RStudio):

  • .Rmd " ", UTF-8
  • knit2html() : options(encoding = 'UTF-8')

+5

All Articles