Suppose to have string like this one:
Çë½ÌΪʲôÎÒÒ»½øÐв鶾ʱ¾Í·¢ÏÖϵͳÅÌ¿ÉÓÃ¿Õ ¼ä¾Í¼±¾ç¼õÉÙ£
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
Ciao mamm@ guardà come mi divertò
I tough that there are 2 mayor differences among the 2:
- Numer of whitespaces/string_lenght
- Number of vocals(aeiou)/string_lenght
Than the code would be something like
if({Numer of whitespaces/string_lenght} < 0.05 (1 every 20 other characters)}
OR {Number of vocals(aeiou)/string_lenght} < 0.2 (1 every 5 other characters)})
return WRONG
else
return OK
Do you have any better idea? Maybe there is some php function already tested that fits my case? Thanks!