Additional info on Solving the Arabic UTF-8 Transaction Issues in the Online Malay-Arabic Dictionary

While maintaining the Web version of this dictionary, I found that there is an important part in our first academic paper that we forgot to mention.  It is the command for the mysql to treat the word entry as in UTF-8 unicode character format.

The code:

if (!mysqli_set_charset($db, "utf8")) {

     printf("Error loading character set utf8: %s\n", mysqli_error($connect));

}

 

//mysql_set_charset — Sets the client character set, so when the data is transfered to the web browser, it is in UTF8 character set.

This function is supposed to be inserted after the PHP page established the connection to the MySQL server. Which looks like the code below.

//to create the bridge

$db=mysqli_connect("localhost","root","","ftsi");

 

//connection failed

if($db==false){//connection error

    echo("Connection failed : ". 

            mysqli_connect_error($db));

    exit();

}

//u are connected to db

else{

    //echo("Connected to database <hr>");

}

 

//Unicode character setting

if (!mysqli_set_charset($db, "utf8")) {

   printf("Error loading character set utf8: %s\n", mysqli_error($connect));

} else {

   //printf("Current character set: %s\n", mysqli_character_set_name($connect));

}

 

Hope this would help!!!

This is our first article published in an academic conference. There is one thing we, somehow or rather, forgot to mention. And we would like you to pardon us. The additional info is as in the code above.