0

I am trying to show some german content in my PHP project but ä is showing as � , word - Termine 2022 abhängig von Sicherheitslage is showing in MySQL database but on web page is is showing as Termine 2022 abh�ngig von Sicherheitslage

Values are coming from MYSQL database

I have tried to use some encoding in header too.

header('Content-Type: text/html; charset=ISO-8859-1');

or

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>

or

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

But nothing works

1 Answers1

1

Thank you for your answer and consideration I solved my issue with

// Create connection
$conn= mysqli_connect($servername,$username,$password,$dbname);

// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}

if (!$conn->set_charset("utf8")) {
 printf("Error loading character set utf8: %s\n", $conn->error);
 } else {
  printf("Current character set: %s\n", $conn->character_set_name());
}