I have an ongoing project where I need to fetch Arabic texts from mysql table and also insert/update them time to time. I have my database collation in "utf8_general_ci".
At first I found question marks "???" upon fetching some of the arabic data. Then I have executed "SET CHARACTER SET utf8". The question mark problem of that particular problem was solved, but then other arabic data started showing gibberish "ÙØ¤ØªØ§". In the project I also need to fetch some data from csv containing arabic texts.
Here is the json data I found before and after the charset execution:
[{
"id": 148,
"domain": 0,
"group_name": "ATX ??????????",
"score": 0,
"player_name": "لاعب واحد",
"created_at": "2015-10-26 13:01:23"
},
{
"id": 148,
"domain": 0,
"group_name": "???? ???????",
"score": 1,
"player_name": "اثنين من لاعب",
"created_at": "2015-10-26 12:59:57"
}]
// ---------------------------------------
// After executing "SET CHARACTER SET utf8"
// ---------------------------------------
[{
"id": 148,
"domain": 0,
"group_name": "ATX توكوروزاوا",
"score": 0,
"player_name": "مؤتا",
"created_at": "2015-10-26 13:01:23"
},
{
"user_id": 148,
"domain": 0,
"group_name": "لندن دينيموز",
"score": 1,
"player_name": "كابوا",
"created_at": "2015-10-26 12:59:57"
}]
Can anyone tell me what is wrong here? I'm trying to fix this but can't find any solution.