title: PERL: how to detect string encoding so I can use the right charset
body: <p>I have these 2 example strings:</p>
  
  <pre><code>$a = "點看"; 
  $b = "pøp";
  </code></pre>
  
  <p>First one is displayed correctly using charset UTF-8, but second string not.
  Second is displayed correctly if charset is changed to iso-8859-1.</p>
  
  <p>I don't know how to display latin1 characters with charset utf-8. 
  Or at least, I need a solution to detect string type (e.g this is "utf-8" or this is "iso-8859-1"), so I can use appropriate charset to display it.</p>