i have the following function to obtain a language strings, it works fine for english but not for portuguese characters.
public function GetAllLanguageStrings($langid)
{
$GLOBALS['mysqli']->query("use " . $GLOBALS['db_name']);
$stmt = $GLOBALS['mysqli']->prepare("SELECT lang_identifier, text FROM lang_strings WHERE lang_id = ?");
$stmt->bind_param("i", $langid);
$stmt->execute();
$stmt->bind_result($identifier,$text);
$result = array("LangStrings" => array());
while ($stmt->fetch()) {
array_push($result['LangStrings'], array("Identifier" => $identifier, "Text" => $text));
}
return json_encode($result, JSON_PRETTY_PRINT);
$stmt->close();
}
the results turn out to be wierd
{ "Identifier": "LOGIN_INFORMATION", "Text": "Informa\u00e7\u00f5es de Login." }
instead of
{ "Identifier": "LOGIN_INFORMATION", "Text": "Informações de Login." }
i tried to add the following settings:
$mysqli->query("SET NAMES utf8");
$mysqli->query("SET CHARACTER SET utf8");
$mysqli->set_charset("utf8");
but nothing changed.