Presentations (slidify and Rpres) with Latin characters (ç, ã, é ...) corrupted

3

I'm preparing slides in R, but Latin characters (ç, ã, é etc ...) become corrupted when the presentation is compiled. I tried both with slidify and with Rpre, same problem. Does anyone know how to solve it?

Editing: If it is within the same section, In R studio, click:

file > "save with encoding" > UTF8

This solves problems when viewing. But a new problem arises:

After saving, when I restart a new section of RStudio and reopen the file the source code appears all 'corrupted' (eg: "attention" turns: "attention"). However the compiled version remains correct ("attention" appears).

I tried again to save with encoding, to continue editing the text, but then it corrops the visibility (compiled version) of the previous text.

Does anyone have a clue how to solve this?

System: Windows 8.1 64bits, R version 3.1.1, RStudio 0.98.1017

    
asked by anonymous 17.09.2014 / 03:03

2 answers

3

I found out how to do it. In R studio, click on:

file > "save with encoding" > UTF8

This solves problems when viewing

In the issue of reopening the file in a new section of RStudio and get to view it correctly and continue adding new content:

  • open the file
  • file > reopen with encoding > UTF8

everything works again

    
17.09.2014 / 03:52
2

Windows default is latin1 (iso 8859-1) and Rpres is generating the HTML file as UTF-8.

When you save the file with UTF-8 encoding, then the HTML and the source file will be the same and the characters will appear correctly.

When you close RStudio and reopen the file, as the default is latin1, but the file is UTF-8, the characters will appear "wrong" ("attention" turns to "attention"). A "workaround" for this is to reopen with UTF-8 (reopen with encoding) encoding to continue working.

Another option is to do everything in latin1 normally (at first it will appear that the html is "wrong") and after you generate the html just change the charset: where you have <meta charset="utf-8"> you change to <meta charset="latin1"> .

Apparently there is no option to tell Rpres what the encoding of your HTML is. If this option were present, it would be enough to specify it to be the same as the encoding of the .rpres file instead of going directly into HTML.

    
15.10.2014 / 17:21