Hi all, I'm having a problem with java script, PHP and utf-8... I've made a little auto completer that uses AJAX. it works great with English letters, but when I enter text in any other language it doesn't work. I know the JS handles the input ok, because if I ask it to repeat the text it will. but when it gets to the client side, my php file, it simply disappears. I've tried to echo the var that comes from the JS - but nothing, empty string... If i put a mixed input of english and non-latin chars, I get squares insted of the non-latin chars, and the english chars are ok. I'm new to programming so it might be something silly . even if its an obvious idea - please tell me because I might not know it yet ... thanks, Yandos.
Hi and thanks for the help i've added it and checked that it is encoded alright (and it does).... but still it dosn't work. I think I need to somehow decode it. googled it and found two options that didn't work for me: $namecard = htmlspecialchars($namecard , ENT_QUOTES, 'utf-8'); HTML: and also another function: htmlentities($str); HTML: any ideas maybe?
You need to configure webserver to use default charset as UTF-8, in Ubuntu + Apache2 it is done by editing file /etc/apache2/conf.d/charset