Storing and retrieving Persian characters

The website in question contains both English and Persian Language. Some database fields store Persian others English in the same table.
I found that if I paste the Persian straight into the HTML it displays correctly. The issues arises somewhere between the communication and storage with the database.

When the query is submitted with PHP, all the characters are converted to ASCII, but many of the characters don’t display correctly when queried.
When the query is submitted through phpMyAdmin, if the field is “utf8_persian_ci” it loads it straight Persian characters, otherwise it is a string of question marks.

However, when the Persian text is pulled form the database it displays as question marks.

Does anyone know how to resolve this issue?

Thank You! E

There was a somewhat similar discussion a few days ago. There is a link in there leading to Kore Nordmans blog posts which should help you.

I figured it out. It is surprisingly simple though it took me a few hours to figure out. Basically, everything needs to be in UTF-8.

Here are my findings if anyone needs them in the future.

Glad you got it sorted, utf-8 all the way is the way to go alright.

The one part of the chain that is usually overlooked is the source file the original document is in. Even copy/pasting to a correctly identified file does not always work out.

Thx for the link.