title: Using Encode::encode with "utf8"
body: <p>So as you probably know, in Perl "utf8" means Perl's looser understanding of UTF-8 which allows characters that technically aren't valid code points in UTF-8. By contrast "UTF-8" (or "utf-8") is Perl's stricter understanding of UTF-8 which doesn't allow invalid code points.</p>
  
  <p>I have a few usage questions related to this distinction:</p>
  
  <ol>
  <li><p>Encode::encode by default will replace invalid characters with a substitution character. Is that true even if you are passing the looser "utf8" as the encoding? </p></li>
  <li><p>What happens when you read and write files which were <code>open</code>'d using "UTF-8"? Does character substitution happen to bad characters or does something else happen?</p></li>
  <li><p>What is the difference between using <code>open</code> with a layer like '>:utf8' and a layer like '>:encoding(utf8)' ? Can both approaches be used with both 'utf8' and 'UTF-8'?</p></li>
  </ol>