detect non ascii characters in a string
<p>How can I detect non-ascii characters in a vector of strings in a grep like fashion.  For example below I'd like to return <code>c(1, 3)</code> or <code>c(TRUE, FALSE, TRUE, FALSE)</code>:</p>
<pre><code>x &lt;- c(&quot;façile test of showNonASCII(): details{&quot;, 
    &quot;This is a good line&quot;, &quot;This has an ümlaut in it.&quot;, &quot;OK again. }&quot;)
</code></pre>
<p>Attempt:</p>
<pre><code>y &lt;- tools::showNonASCII(x)
str(y)
p &lt;- capture.output(tools::showNonASCII(x))
</code></pre>