title: Read encoding of an existing connection object
body: <p>Is there any way to get (and set) the <code>encoding</code> of an existing connection? For example:</p>
  
  <pre><code>con &lt;- file(tempfile(), encoding = "UTF-8")
  summary(con)
  </code></pre>
  
  <p>The summary lists the mode and if it has been opened, but not the encoding that the connection uses.</p>