I am using PHP and MySQL for saving Arabic data.
My database collation is : utf8_general_ci
My database Character set is : utf8
At first I did not use SET NAMES utf8
before insertion so the data was inserted in strange characters in the database but was displayed properly in my application. After using SET NAMES utf8
, data is inserted properly but the old data is not displayed in Arabic characters even in my application (The new data is ok) .
How can I update all the data to be displayed in Arabic letters in both my application and MySQL database?
Update
When I check the encoding of the both of strings ( the one that is inserted and the one that I want to convert to ) using mb_detect_encoding
function I get that both of the strings are UTF-8 .
Here is an example of the two strings :
the text inserted : الإسم بالعربية
the text I need to convert to : الإسم بالعربية