Non-English characters are a headache, but in the past few years, dealing with them has been made easier. First things first, make sure your varchar and text column collations in your database are set to utf8mb4_unicode_ci.
You'll then need to make sure that when you query your database, you're querying it in UTF8. Run the following query after connecting to the mySQL server from PHP, but before running any other query:
SET NAMES utf8mb4;
Finally, make sure the page you're displaying the text is also UTF8 ready. Most browsers default to it nowadays, but just to be on the safe side, set the following tag in your HTML header:
<meta charset="utf-8">
If you're using mysqli, perhaps the below snippet is helpful:
# Set up the mysqli driver
$driver = new mysqli_driver();
# Report all errors
$driver->report_mode = MYSQLI_REPORT_STRICT | MYSQLI_REPORT_ERROR;
# Try connecting
try {
$mysqli = new mysqli($_ENV['db_servername'],$_ENV['db_username'], $_ENV['db_password'], $_ENV['db_database']);
}
catch(mysqli_sql_exception $e) {
if ($mysqli->connect_error) {
die("[Error #{$mysqli->connect_errno}] {$mysqli->connect_error}");
} else {
die($e->getMessage());
}
}
# Ensure everything is UTF8mb4
$mysqli->set_charset('utf8mb4');
# Ensure PHP and mySQL time zones are in sync
$offset = (new \DateTime())->format("P");
$mysqli->query("SET time_zone='$offset';");