output problems UTF-8??plzzzz help

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
hi guys i have a problem with the output of my script...

1- i created a simple MySQL Database using phpMyAdmin and the encoding
was "utf8_general_ci"
2- i addes a few rows in a table in ARABIC
3- the names shows well in phpMyAdmin

the problem is when i want to display them in PHP they all come out in
"???????" i tried using english names and everything worked well, but
it wont work with arabic?!!!

i've already set the page headers to "utf-8" but nothing chnaged!!

i'm using Textpad to edit my php files?
i've tried to save the file in UTF-8 but nothing!!

Re: output problems UTF-8??plzzzz help

1. Use phpMyAdmin to make sure your MySQL connection encoding is also UTF-8

2. Make sure all of the following are set to UTF-8 encoding, not just  
one of them (I think column is the only important one anyway though):
  - Database
  - Table
  - Column

3. Try using the htmlspecialchars() function on the output if you aren't  
already (you should be already using anyway).

Re: output problems UTF-8??plzzzz help

Quoted text here. Click to load it

When connecting to MySQL 5+, the default client encoding is taken to be
latin-1, even if you set it to utf-8 in the config file ([mysql]
section). You will have to issue a "SET NAMES utf8" command after
connecting, otherwise MySQL will RE-encode from latin-1 to utf-8!

If you want to see what encoding really is stored in the database (and
if the data is re-encoded), use the mysqldump utility.

Best regards,
Willem Bogaerts

Application smith
Kratz B.V.

Re: output problems UTF-8??plzzzz help

Thanks guys i'll try them and tell you what happens...

Best Regards

Site Timeline