title: use of unicode in R markdown
body: <p>I have a function that prints some unicode characters to the console. This works perfectly fine when executed in the console, but when I run the same command in a chunk in an R markdown document some of the characters don't display correctly.</p>
  
  <p>Here is a toy example:</p>
  
  <pre><code>test &lt;- function() cat("\U003BC \U002260 \U003C0\n")
  </code></pre>
  
  <p>when run in the R console shows μ ≠ π, but when run in a chunk it does the mu correctly but not the other two, see attached screenshot.</p>
  
  <p><a href="https://i.stack.imgur.com/MJ5Yt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MJ5Yt.png" alt="enter image description here"></a></p>
  
  <p>Update: thanks for the replies so far. It seems that this is an issue with base R on Windows. The suggestion to use </p>
  
  <pre><code>knitr::asis_output(test1())
  </code></pre>
  
  <p>works. I also tried to use the chunk option results='asis', but this does not work, so somehow there is a difference between these two. </p>
  
  <p>At least I now have a way to do what I want, except that I need to rewrite a number of routines to return the character string instead of using cat to print it. </p>