I am using Acrobat professional to create a PDF Form, the form is filled with arabic, and I created a PHP file to get the form fields and insert it into a mysql database, I tried decoding the arabic text ãÍãÏ with utf_encode() and utf_decode() the word is محمد and the database is utf8_bin. and solutions?
<?php
error_reporting(E_ALL & ~E_NOTICE);
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "dbTest";
if (isset($_POST['txtName'])) {$txtName= $_POST['txtName'];};
$link = mysqli_connect($servername, $username, $password, $dbname) or die("UNable to connect");
$qq1 = "set character_set_server='utf8'";
$qq2 = "set names 'utf8'";
//mysqli_query($link, $qq1) or die(mysqli_error($link));
//mysqli_query($link, $qq2) or die(mysqli_error($link));
//$txtName = iconv("UTF-8//TRANSLIT//IGNORE", "Windows-1252//TRANSLIT//IGNORE", $txtName);
//$txtName = iconv("Windows-1256//TRANSLIT//IGNORE", "UTF-8//TRANSLIT//IGNORE", $txtName);
$query = "INSERT INTO tblTest Values('$txtName')";
mysqli_query($link, $query) or die(mysqli_error($link));
?> and here is the database
CREATE TABLE IF NOT EXISTS `tbltest` (`txtName` varchar(244) COLLATE tf8_bin DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
INSERT INTO `tbltest` (`txtName`) VALUES
('ãÍãÏ Úæäí ãÍãæÏ');