I am developing a php website with the Yii Framework on my local machine:
- OS X El Capitan
- PHP 5.6.6
- Apache/2.4.16
I'm reading some data from database and trying to json_encode them but, when these data contain some accented letters, json_encode fails and returns false.
I also tried to use iconv() to convert the problematic strings but also iconv return false with the following error: Detected an illegal character in input string.
I am sure the problem is not related to database data (I tried to access the same database remotely using a Linux machine with PHP 5.6.7 and the same code works great).
The problem seems to be in some encoding setting I am forgetting.