Problem: An external character is not displayed as it should. This includes German, Japanese, Russian, and everything else except English (works great). Ones PHP accesses MySQL through a jQuery AJAX call, it must return information and display it on the page. Data is called up and displayed. However, for non-English characters, the results are displayed as "?".
In phpMyAdmin, data is displayed as it should have been in Japanese, German ect ect. But those derived from MySQL are not returned as such.
The problem is not caused by the browser, as my browser supports encodings of all languages.
MySQL encoding: UTF8_GENERAL_CI
Page Encoding: UTF-8
<meta charset="utf-8" />
The problem may be retrieving PHP data from MySQL, since in MySQL it looks great, viewed through phpMyAdmin. So, here is the code used to extract this data from MySQL. If the encoding should not be included in this file.
view.php (selecting the necessary data from MySQL can cause an encoding error)
$q = mysql_query("SELECT * FROM `notice` WHERE nid = '".$nid."'");
$a = mysql_fetch_array($q);
$nid = stripslashes($a['nid']);
$note = stripslashes($a['note']);
$type = stripslashes($a['type']);
$private = stripslashes($a['private']);
$date = stripslashes($a['date']);
$author = stripslashes($a['author'])
;
PS. Edited to be more clear.
source
share