title: How to detect wrongly encoded strings in PHP
body: <p>Suppose to have string like this one:</p>
  
  <pre><code>Çë½ÌÎªÊ²Ã´ÎÒÒ»½øÐÐ²é¶¾Ê±¾Í·¢ÏÖÏµÍ³ÅÌ¿ÉÓÃ¿Õ ¼ä¾Í¼±¾ç¼õÉÙ£
  </code></pre>
  
  <p>They have been wrongly encoded. How do you think it's possible to know if in fact, it's wrongly encoded?
  An example of right encoded string would be</p>
  
  <pre><code>Ciao mamm@ guardà come mi divertò
  </code></pre>
  
  <p>I tough that there are 2 mayor differences among the 2:</p>
  
  <ul>
  <li>Numer of whitespaces/string_lenght</li>
  <li>Number of vocals(aeiou)/string_lenght</li>
  </ul>
  
  <p>Than the code would be something like</p>
  
  <pre><code>if({Numer of whitespaces/string_lenght} &lt; 0.05 (1 every 20 other characters)}
       OR {Number of vocals(aeiou)/string_lenght} &lt; 0.2 (1 every 5 other characters)})
    return WRONG
  else
    return OK
  </code></pre>
  
  <p>Do you have any better idea? Maybe there is some php function already tested that fits my case? Thanks!</p>