0 Replies Latest reply on Jan 19, 2012 3:57 AM by CilonS

    Problem when saving diacriticals from PDF form in MYSQL.

    CilonS

      Hello!

       

      I made an application using PHP that opens a PDF form and saves the filled data into a MYSQL database. 

       

      The MYSQL database collation is utf8_unicode_ci (table, fields etc).

       

      I have changed also the encoding of the files from ANSI to UTF8.

       

      In the php script that does the submit of the form i have set the following:

      header('Content-type: text/html; charset=UTF-8');

      ..

       

      $dbConn    = mysql_connect($server, $user, $password) or die("Error connecting to MySQL server! : ".mysql_error());

      mysql_select_db($database) or die("Error selecting database $database! : ".mysql_error());

      mysql_query("SET NAMES 'utf8' ");

       

      In the meta of the HTML i placed:

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

       

      The problem is that on submit the diacriticals so not save at all, and if i remove the code  mysql_query("SET NAMES 'utf8' "); instead of the diacriticals there are some weird characters in the table fields.

       

      Is the same thing when trying to retreive data written with diacriticals from database to PDF.

       

      What must be done for this to work as intended?