1

I try to convert text in mysql database that appearing that way ** Tarifs préférentiels pour la location de voi... ** to utf8, i use this query but not working. Any help !

$conn = mysqli_connect('localhost', 'root', '', 'sarldbcatw');
            mysqli_select_db($conn,'sarldbcatw')or die('Erreur de selection '.mysqli_error());

                $conn->set_charset("utf8");
                $slq = "SELECT Id_pdf, texte_pdf FROM mtbl_mazel_pdf order by Id_pdf";

            $req = mysqli_query($conn,$slq) or die('Erreur SQL !'.$sql.'<br>'.mysqli_error()); 
             while($data = mysqli_fetch_assoc($req))  {

               $texte_pdf=$data['texte_pdf']; 
               $Id_pdf = $data['Id_pdf'];
               $texte_pdf =  html_entity_decode($texte_pdf);
                 $sqlfic = "UPDATE mtbl_mazel_pdf SET texte_pdf='$texte_pdf'  WHERE  Id_pdf =".$Id_pdf;
                 mysqli_query($conn,$sqlfic) or die('Erreur SQL !'.$sqlfic.'<br>'.mysqli_error());

             }
Diasline
  • 625
  • 3
  • 32
  • That is the UTF. ASCII would look like: `Tarifs pr\u00C3\u00A9f\u00C3\u00A9rentiels pour la location de voi...` – Ani Menon Jun 11 '16 at 16:43
  • this is a french text how to convert it clearly ? – Diasline Jun 11 '16 at 16:47
  • P0ssible duplicate of: http://stackoverflow.com/questions/279170/utf-8-all-the-way-through – arkascha Jun 11 '16 at 16:50
  • the data that i want to convert to utf8 are locate in a mysql table. So i need a query that can make the conversion in the table so that text appear properly in french. – Diasline Jun 11 '16 at 16:57
  • what encoding does your table use? – SML Jun 11 '16 at 16:58
  • 1
    Log into your phpMyadmin to view the data stored in MySQL, see if the data is stored as garbled text. If so, the encoding of the page where you write to the database isn't set to UTF8. The link arkascha posted has all the info you need really. Secondly don't forget to tag the person you post your comment to, otherwise the intended recipient doesn't get notified – SML Jun 12 '16 at 12:08

0 Answers0