Encoding issue with GT object in markdown

Recently, I updated R and RStudio, and I encountered a problem regarding the combination of Hebrew inside GT tables. The problem only occurs when I generate a markdown file. I read all kinds of similar issues, but I couldn't find anything that worked for me.
The scenario is as follows:
I can create the table on my console and it will show up correctly in the RStudio viewer.
The following is a repex code for creating a table in my weird little language:

library(gt)
library(tidyverse)
Name <- c("בן", "דנה", "דג", "בוריס", "נומי")
Age <- c(23, 41, 32, 58, 26)
df <- data.frame(Name, Age)

table<- df %>% 
  gt()
table

it suppose to look like this:
table

When I combine the table inside a rmd file it will messed up looks like in the picture bellow.


As you can see, the title and the text below the table looks fine.

Here is the code for rmarkdown, I hope you'll be able to reproduce the issue.
Thank you!

---
title: "כותרת"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(gt)
library(tidyverse)

Name <- c("בן", "דנה", "דג", "בוריס", "נומי")
Age <- c(23, 41, 32, 58, 26)
df <- data.frame(Name, Age)

table<- df %>% 
  gt()

```

```{r table, echo=FALSE}
table
```
<div> טקסט שכן עובד בעברית</div>

``` 

I can reproduce I think.

I believe this would be an issue to open in gt so that we can work on it - there may be something off when doing the writing to HTML output when gt prints inside a R Markdown document.

Can you open an issue there with this example ? Thanks!

OK, thanks! I never opened an issue on github, but there's a first time for everything :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.