So far I was using combination of R + Rstudio + knit (to mostly HTML) in english so perhaps that's why I never stumbled on this issue. Recently, however, I started writing a doc in polish and noted that whether I knit to HTML or PDF, the text loses polish symbols. So in example the following sentence:
Warto podkreślić, że zaznaczona na osi wartość...
Is rendered as this:
Warto podkreslic, ze zaznaczona na osi wartosc...
And - just for your curiosity - in english it means:
Worth to point out, that the value marked on axis...
This is extremely troublesome. I checked that the original file is encoded in UTF-8 so correctly. I checked that all settings in Rstudio are set to utf-8 as well. Going through the call I'd also say it should work as UTF-8 so I'm puzzled what's wrong.
Now as I'm writing this question, I tested that when I i.e. produce graph in R (graph is in ggplot2) without knitting the document, it also loses polish symbols. Perhaps the issue is with R itself and not a fault of knit then? Is it even possible to encode a doc in R properly or is it latin1 or nothing?
I'm not sure what additional information I should provide to help you determine what's wrong. I'm running on Windows 10.