title: Twig : Unescape hexadecimal text
body: <p>I try to secure email address on my website and I used the function (twig filter) below to encode it :</p>
  
  <pre><code>/**
   * The twig filter associated with this function is "encode_email"
   */
  function encode_emailFilter($email) 
  { 
      $text = $email; 
      $text_encode = ''; 
  
      for ($x=0; $x &lt; strlen($text); $x++) { 
          $text_encode .= '&amp;#x' . bin2hex($text[$x]).';'; 
      } 
  
      return $text_encode; 
  } 
  </code></pre>
  
  <p>So, I encoded my email like this</p>
  
  <pre><code>{{ emailFromDatabase|encode_email }}
  </code></pre>
  
  <p>And on my HTML page, it shows</p>
  
  <pre><code>&amp;#x73;&amp;#x75;&amp;#x70;&amp;#x65;&amp;#x72;&amp;#x6d;&amp;#x61;&amp;#x72;&amp;#x69;&amp;#x6f;&amp;#x40;&amp;#x67;&amp;#x6d;&amp;#x61;&amp;#x69;&amp;#x6c;&amp;#x2e;&amp;#x63;&amp;#x6f;&amp;#x6d;
  </code></pre>
  
  <p>I tried to add "<a href="http://twig.sensiolabs.org/doc/filters/raw.html" rel="nofollow">raw</a>" to the filter but, I always get the same result</p>
  
  <pre><code>{{ emailFromDatabase|raw|encode_email }}
  </code></pre>
  
  <p>However, if I display directly the hexadecimal without wrapping it with <code>{{ }}</code>, the email address displays correctly</p>
  
  <pre><code>&lt;span&gt;&amp;#x73;&amp;#x75;&amp;#x70;&amp;#x65;&amp;#x72;&amp;#x6d;&amp;#x61;&amp;#x72;&amp;#x69;&amp;#x6f;&amp;#x40;&amp;#x67;&amp;#x6d;&amp;#x61;&amp;#x69;&amp;#x6c;&amp;#x2e;&amp;#x63;&amp;#x6f;&amp;#x6d;&lt;/span&gt;
  
  //Returns
  supermario@gmail.com
  </code></pre>
  
  <p>So, what filter should I add to my twig variable to get it work?</p>
  
  <p>Thanks in advance for your answers</p>