How to make a Mysql database to support Arabic?

I am trying to save the Arabic language in the mysql database, but it does not save in Arabic format. It displays question marks instead of Arabic. How to make it keep values ​​in Arabic.

I have tried many requests from the Internet, but that does not change. How to change it to Arabic. "ar_SA: Arabic - Saudi Arabia" Please suggest a way?

+5
source share
3 answers

Just use UTF-8 in the encoding of the page, in connection with the database and the database itself.

+6
source

I am using WAMP Server. (Windows, Apache, MySQL, PHP).

//so important

THE FIRST:

phpmyadmin MySQL: , Mysql - utf. , utf-general-ci

Mysql ( ) .

mysql_set_charset('utf8');

:

<?php
     //connect to MySQL
     mysql_connect("localhost", "user", "password") or die(mysql_error());
     mysql_set_charset('utf8'); // that the order.
     echo "Connected to MySQL<br />";

     //connect to your DB
     mysql_select_db("mydb") or die(mysql_error());
     echo "Connected to Database";
?>

: php :

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

-: , php utf-8. u IDE, ++ Komodo Edit, .

// , .

php ( ).

<?php header("Content-type: text/html; charset=utf-8"); ?>

:

<form accept-charset="utf-8" ...>
+6

, - utf8_general_ci

+1

All Articles