title: turn non-ascii character into their unicode form
body: <p>I'm writing a package function where I want to check if some text contains any of the following characters:</p>
  <pre><code>äöüßâçèéêîôûąęćśłńóżźžšůěřáúëïùÄÖÜSSÂÇÈÉÊÎÔÛĄĘĆŚŁŃÓŻŹŽŠŮĚŘÁÚËÏÙ
  </code></pre>
  <p>Problem is that <code>devtools::check()</code> returns a warning:</p>
  <blockquote>
  <p>W  checking R files for non-ASCII characters ...     Found the
  following file with non-ASCII characters:
  gb_data_prepare.R    Portable packages must use only ASCII characters in their R code,    except perhaps in comments.    Use
  \uxxxx escapes for other characters.</p>
  </blockquote>
  <p>So I tried to convert these characters into unicode, but actually don't really know how.</p>
  <pre><code>stringi::stri_encode(&quot;äöüßâçèéêîôûąęćśłńóżźžšůěřáúëïùÄÖÜSSÂÇÈÉÊÎÔÛĄĘĆŚŁŃÓŻŹŽŠŮĚŘÁÚËÏÙ&quot;, to = &quot;Unicode&quot;)
  
  Error in stringi::stri_encode(x, to = &quot;Unicode&quot;) : 
    embedded nul in string: '\\xff\\xfe\\xe4'
  </code></pre>
  <p>doesn't work. Same with</p>
  <pre><code>iconv(&quot;äöüßâçèéêîôûąęćśłńóżźžšůěřáúëïùÄÖÜSSÂÇÈÉÊÎÔÛĄĘĆŚŁŃÓŻŹŽŠŮĚŘÁÚËÏÙ&quot;, from = &quot;UTF-8&quot;, to = &quot;Unicode&quot;)
  
  Error in iconv(x, from = &quot;UTF-8&quot;, to = &quot;Unicode&quot;) : 
    unsupported conversion from 'UTF-8' to 'Unicode' in codepage 1252
  </code></pre>
  <p>Any ideas what I can do?</p>
  <p>Note: weird thing also is that if I do:</p>
  <pre><code>x &lt;- &quot;äöüßâçèéêîôûąęćśłńóżźžšůěřáúëïùÄÖÜSSÂÇÈÉÊÎÔÛĄĘĆŚŁŃÓŻŹŽŠŮĚŘÁÚËÏÙ&quot;
  </code></pre>
  <p>x now returns <code>&quot;äöüßâçèéêîôûaecslnózzžšueráúëïùÄÖÜSSÂÇÈÉÊÎÔÛAECSLNÓZZŽŠUERÁÚËÏÙ&quot;</code> which is wrong. So I guess it also has something to do with my general R encoding?</p>