6. Try the different options
Ok, now it's time to try with the different options in the gateway.php file and look at the results in flash.
I will reproduce the effect of inserting the same couple of strings with different parameters passed in the setCharsetHandler. I will write in the input text field these strings for every test:
The result:
The result:
The result:
The result:
In this example all the strings are inserted correctly in our database (using utf-8), but when amfphp gives the strings back to flash it uses ASCII encoding and for this reason they are not correctly decoded back.
Setting setCharsetHandler("mbstring","UTF-8","UTF-8") will give the correct results in the datagrdi too.
Let's try with iconv. The result:
The result:
The result:
7. Conclusion
- If your php has libiconv enabled then use iconv has the default encoder.
- Whenever possible always use UTF-8 encoding both for writing and for reading the database.
- use utf-8 as default character set for your database in mysql
