Home » Php » php – Why the arabic character is saving the My sql as another format?

php – Why the arabic character is saving the My sql as another format?

Posted by: admin February 25, 2020 Leave a comment

Questions:

We have an old windows application, in which the Arabic data is saved to the MYSQL database in ÇáÔæÑÈÇÊ (this format). When we read the data with the windows application it automatically converts the given format (ÇáÔæÑÈÇÊ) to normal Arabic without any problem.

Now we are changing the windows application to a laravel application. but laravel show the data ÇáÔæÑÈÇÊ as itself without converting it to the Arabic.

Do anyone know any way to convert these format to Arabic to display in the web application or can anyone explain what format is this (ÇáÔæÑÈÇÊ)?

How to&Answers:

Try to alter table with this:

ALTER DATABASE `dbname` CHARACTER SET utf8 COLLATE utf8_general_ci;

and then

ALTER TABLE `table_name` CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci