Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R-Notebooks: German Umlaute break knitr::kable in R-Notebook Preview #860

Closed
tilltnet opened this issue Nov 8, 2016 · 6 comments · Fixed by rstudio/rstudio#883
Closed

Comments

@tilltnet
Copy link

tilltnet commented Nov 8, 2016

Hi, I hope this is the right place for R-Notebook Issues.

I installed R-Studio 1.0.44 and updated all Notebook/ RMarkdown related packages.

When I use knitr::kable on data.frames, that contain german Umlaute like ä,ö,ü I get a "Invalid UTF-8 stream" error.

Here is a short example:

---
title: "R Notebook"
output:
html_notebook: default
---

```{r}
data.frame(x=c(1,2,3), y = c("ä",2,4))
knitr::kable(data.frame(x=c(1,2,3), y = c("a",2,4)))
knitr::kable(data.frame(x=c(1,2,3), y = c("ä",2,4)))
```

The first two lines work as expected, the last line produces this:

pandoc.exe: Cannot decode byte '\xe4': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS "C:\Users\X\AppData\Local\Temp\RtmpGwUchp\_rs_md_172ca734178.md" --to html --output "C:\X\.Rproj.user\shared\notebooks\FA410CF6-test\1\D73DC468\c5zeemgm7m62l_t\_rs_html_172c15805e1d.html"' had status 1
Error: pandoc document conversion failed with error 1`
@kevinushey
Copy link
Contributor

I believe this bug is independent of knitr; it's specifically a bug in the render() handlers set up by RStudio. Can you try downloading the daily version of RStudio, and let us know if the issue is resolved there?

https://dailies.rstudio.com/

@tilltnet
Copy link
Author

tilltnet commented Nov 8, 2016

I installed the daily, but the problem remains.

After installing the daily the 'rprojroot' was prompted for an update and executing a code chunk brought up a message, that there was no 'rmarkdown' package installed. I installed it and than then the chunk was again rendered with the same error for the dataframe containing an Umlaut.

When I knit the same document there is no problem.

Here is the traceback of the error:

pandoc.exe: Cannot decode byte '\xe4': Data.Text.Internal.Encoding.Fusion.streamUtf8: Invalid UTF-8 stream
running command '"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS "C:\Users\x\AppData\Local\Temp\Rtmpkl65y3\_rs_md_19747554918.md" --to html --output "C:\Users\x\.Rproj.user\shared\notebooks\FA410CF6-test\1\D73DC468\c5zeemgm7m62l_t\_rs_html_19743d22eff.html"' had status 1

Error: pandoc document conversion failed with error 1
6. stop("pandoc document conversion failed with error ", result, call. = FALSE)
5.rmarkdown::pandoc_convert(input = rmarkdown::pandoc_path_arg(mdfile), to = "html", output = rmarkdown::pandoc_path_arg(htmlfile))
4.print.knit_asis(knitr::asis_output(x))
3.print(knitr::asis_output(x))
2.print.knitr_kable(x)
1.function (x, ...) UseMethod("print")(x)

@kevinushey
Copy link
Contributor

Can you also post the output of utils::sessionInfo()?

@kevinushey
Copy link
Contributor

I've reproduced this on a Windows VM; we should be able to get this fixed on the RStudio side soon. Thanks for reporting!

@davidizquierdogomez
Copy link

this is crazy but this little last comment about "Ñ" letter is the key to solve the problem....thank you very much indeed yihui

@github-actions
Copy link

github-actions bot commented Dec 8, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants