1
$str = 'elhamdûlillahî rabbil âlemin';

I am sending something like this. It does not appear correctly. I 've tried many things.

Or should i do something in my PHP page? How can i understand what collation style my PHP page using? and how to change it? Thanks.

Webber Depor
  • 198
  • 4
  • 16
  • Declaring it as UTF-8 in your meta tags will probably solve your problem. But if you are going to store strings like this in a MySQL database, for instance, then maybe you have to do some magic to it. – Ed de Almeida Mar 07 '16 at 14:59
  • **Collation** is used for performing string *comparisons*. You have not mentioned that you're performing a comparison, nor (if you are) what (if anything) is wrong with that comparison. Therefore I don't think you actually meant to discuss "collation" in your question. **Encoding**, on the other hand, is a means of representing text inside a computer—and if the software you use expects a different encoding to that actually used, you'll encounter problems of the sort you describe. So you likely have an "encoding" issue. See [UTF-8 all the way through](https://stackoverflow.com/q/279170). – eggyal Mar 07 '16 at 15:03
  • @EddeAlmeida its not about html. pure PHP sends the string. So meta tag is not the solution – Webber Depor Mar 07 '16 at 15:06
  • 1
    Possible duplicate of [UTF-8 all the way through](http://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – FirstOne Mar 07 '16 at 15:06
  • @FirstOne yes it did the magic. All i need was `$mysqli->set_charset('utf8')` in my PHP page. – Webber Depor Mar 07 '16 at 15:17
  • "Does not appear correctly?" `â î û` (Mojibake)? Question mark(s)? Truncation? `� � �`? – Rick James Mar 07 '16 at 20:36

0 Answers0