title: How to Encode and Decode "Acute accented characters" using Perl
body: <p>I am working in a web based educational website, where we are using Perl, MySQL 5, Apache and Template Toolkit. we are planning to introduce the support for multiple\ Language in our website.</p>
  
  <p>What we have done in </p>
  
  <p>IF we have a Tab name like Courses Main Page&lt;\h1> in our template file, we have converted that to  </p>
  
  <pre><code>&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;h1&gt;[% glossary.$language.courses_main_page %]&lt;\h1&gt; 
  </code></pre>
  
  <p>where $language is getting the value which user selects when he logs in.</p>
  
  <p>We have a table to maintain this data in our Mysql DB:</p>
  
  <blockquote>
    <p>CREATE TABLE <code>translation</code> (   <code>english</code> varchar(255) NOT NULL,<br>
    <code>language</code> varchar(255) NOT NULL,   <code>translation</code> varchar(2000) NOT
    NULL, ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Translation of
    Element text to a foreign language'</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/igv6x.jpg" alt="enter image description here"></p>
  
  <p>IN the connect function of MySQL, I am providing 'SET character_set_results=NULL'.
  I tried with utf8, but the issue which is limited to some tabs got increased to many sections.</p>
  
  <p>So as soon as the user logins into the system, we fetch all the translation and store it in a PERL hash and Cache it. we pass this hash to template file which will replace the value.</p>
  
  <p>Problem: Acute accented characters like á and é etc are getting replaced with some different character set symbols.</p>
  
  <p>For ex: in Front end we are seeing "Cursos PÃ¡gina Principal" for Cursos Página Principal.</p>
  
  <p>It is very similar to the solution given in <a href="https://stackoverflow.com/questions/7663738/htmlentities-and-e-e-acute">htmlentities and &#233; (e acute)</a></p>
  
  <p>Can any one tell me how to achieve the same in Perl.</p>