title: Special characters in knitr (cairoDevice doesn't work)
body: <p>I have problem with special characters in my knitr document. Normal text works fine but the polish letters in the title or axis name on the picture doesn't. 
  <img src="https://i.stack.imgur.com/ubB5n.png" alt="enter image description here"></p>
  
  <p>I tried to fix this with installing cairoDevice package. But it still doesn't work. Actually I'm not sure if this package works properly, because I had to install also Rgtk2 package and there were problems with it too. Is there any other way to havepolish letters, another than cairoDevice? If not how to make it work properly?</p>
  
  <p>Here's my knitr file <code>problem.Rnw</code>:</p>
  
  <pre><code>\documentclass[12 pt, a4paper]{article}
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{polski}
  \usepackage{geometry}
  \geometry{total={210mm, 297mm}, left=17mm, right=17mm, top=17mm, bottom=17mm}
  \usepackage[font=footnotesize,labelfont=bf]{caption}
  \usepackage{url}
  \usepackage[colorlinks=true]{hyperref}
  \hypersetup{linkcolor=blue}
  
  &lt;&lt;include=F&gt;&gt;=
  source("My path/plot.R")
  @
  
  &lt;&lt;include=F&gt;&gt;=
  library(knitr)
  library(RGtk2)
  library(Cairo)
  library(cairoDevice)
  
  #ustawienia globalne
  opts_chunk$set(fig.path='figure/', fig.align='center', fig.show='asis', fig.pos='ht!', dev='CairoPDF')
  
  @
  
  \begin{document}
  
  &lt;&lt;MusicBad, echo=F, fig.width=5, fig.height=5, out.width='.5\\linewidth', fig.cap='Błędne zastosowanie wykresu liniowego.'&gt;&gt;=
  
  plot.music.bad
  
  @
  \end{document}
  </code></pre>
  
  <p>and here my <code>plot.R</code> file:</p>
  
  <pre><code>library(ggplot2)
  
  #create data frame
  music &lt;- c("Blues", "Hip-hop", "Jazz", "Metal", "Rock")
  number &lt;- c(8, 7, 4, 6, 11)
  df.music &lt;- data.frame(music, number)
  
  #create line graph 
  plot.music.bad &lt;- ggplot(data=df.music, aes(x=music, y=number, group=1)) +
    geom_line(size=1, color="#333333") +
    geom_point(size=3, color="#333333") +
    xlab("Rodzaj muzyki") +
    ylab("Liczba studentów") +
    ylim(c(0,11)) +
    ggtitle("Ulubiony typ muzyki wśród studentów")
  </code></pre>
  
  <p>Do you know how to fiz this? I just want to have polish letters in the graphics. Thank you.</p>
  
  <p>EDIT
  My sessioninfo:</p>
  
  <blockquote>
    <p>sessionInfo()</p>
  </blockquote>
  
  <pre><code>R version 2.15.3 (2013-03-01)
  Platform: x86_64-w64-mingw32/x64 (64-bit)
  
  locale:
  [1] LC_COLLATE=Polish_Poland.1250  LC_CTYPE=Polish_Poland.1250   
  [3] LC_MONETARY=Polish_Poland.1250 LC_NUMERIC=C                  
  [5] LC_TIME=Polish_Poland.1250    
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  loaded via a namespace (and not attached):
  [1] tools_2.15.3
  </code></pre>
  
  <p>If I run this plot from console it works fine. I had the same problem with saving it to pdf but if I run <code>cairo_pdf(name, width=width, height=height)</code> instead of <code>pdf(name, width=width, height=height)</code> it it saved with special characters.</p>