crodas / LanguageDetector

PHP Class to detect languages from any free text
320 stars 67 forks source link

Catalan language [ used in ... /example/classify.php ] fails #9

Closed redaktor closed 11 years ago

redaktor commented 11 years ago

Hey there,

the example does not work for me because of the catalan characters à and è.

Another user described exactly my problem here: http://stackoverflow.com/questions/16079407/catalan-characters-a-and-e-dont-work-with-php-imagestringup-how-to-decode-the

redaktor commented 11 years ago

OK - FIGURED IT OUT !!! :+1:

If someone has the mbstring lib enabled, the script fails for some languages. I placed

mb_internal_encoding('UTF-8');

in ... lib/LanguageDetector/NGramParser.php

and now everything works. Contribution follows ...

Visca el Barça i visca Catalunya ;)