0

I have checked that Mysql Database,Table, and Column Collation is set to utf8_general_ci.

The mysqli connection is set the utf8

Here is the code:

private function __construct () {
    if(! $this->mysqli =  new mysqli('localhost', 'root', '', 'game') ) {
            $this->errors = $this->mysqli->connect_error;
            mysqli_set_charset($this->mysqli, "utf8");
    }
}

But when I insert some arabic characters then it's showing me this: Ø­ Its should be arabic character. How can I solve it?

Shibbir
  • 409
  • 3
  • 14
  • With the given informations it is not really possible to tell you where the problem is. It could be at various places. The encoding of the data you send to the database could be already wrong. The data could be stored correctly but when you read it for the database and display it you might do something wrong. Where does it show you `Ø­`, you you check that in e.g. phpmyadmin? – t.niese Apr 11 '18 at 05:38
  • Yes, it's showing the character in mysql table – Shibbir Apr 11 '18 at 05:43

1 Answers1

0

Here is the simplest way to solve it:

- Import your backup file
- Export it again, but using latin1 encoding
- Manually edit the exported file, change all occurrences of latin1 to utf8.
- Import the edited file.

if you don't find latin1, Note that latin1 is the same as ISO-8859-1

J.Dev
  • 39
  • 9