2

I am trying to store french string in mysql DB but it not get proper stored and changed some characters and not get display proper in my webpage

Original string: Bonjour Mr/Mme « Nom de famille du prospect », je suis « votre prénom » d’Europ Assistance La Téléassistance…

Stored string : Bonjour Mr/Mme « Nom de famille du prospect », je suis « votre prénom » d’Europ Assistance La Téléassistance…

I have tried with many solutions

  • header('Content-Type: text/html; charset=UTF-8');,
  • Collation is utf8_unicode_ci,
  • Used SET NAMES UTF8,
  • tried mysqli_set_charset($conn,"utf8") when select from DB,
  • Also tried with ISO-8859-1

Also tried many HTML functions but did not work character_set_name is utf-8

character_set_name is utf-8

  • You must have utf8 all the way through. so check the connection string if there is also a utf8 – nbk Jun 05 '20 at 11:56
  • Is there any code involved you want to share? – Nico Haase Jun 05 '20 at 12:00
  • @NicoHaase Nothing to show in code just simple mysql query to select string from DB – Nikunj Kayasth Jun 05 '20 at 12:17
  • Well, then there is some bug in your configuration. But as you haven't shown any code samples to trigger the problem nor the database configuration, it's close to impossible to provide help – Nico Haase Jun 05 '20 at 12:18
  • @nbk how to check connection string for utf-8, are you talking about my $conn DB connection variable? – Nikunj Kayasth Jun 05 '20 at 12:19
  • Please post you code with the connection string. You seem also to have a **sql injection problem**. And check @Dharman link – nbk Jun 05 '20 at 12:54

1 Answers1

0

Check the collation type of your MySql tables, it shloud be set at "utf8" to correctly encode accents on letters. You could also try "utf8mb4".

Eclipse
  • 3
  • 2