Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat may cause question marks instead of non-ASCII symbols?
    primarykey
    data
    text
    <p>Can't figure out why is it happening, there is definitely something wrong with the enviroment. I have db declared as</p> <pre><code>CREATE DATABASE `mydb` /*!40100 DEFAULT CHARACTER SET latin1 */ </code></pre> <p>Then I have a table declared as </p> <pre><code>CREATE TABLE `myabstract_table` ( `key_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `varchar_field` varchar(128) NOT NULL PRIMARY KEY (`key_id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; </code></pre> <p>Then I have usual for this case php code:</p> <pre><code>function execSQL($conn, $sql, $values = false) { try { $stmt = $conn-&gt;prepare($sql); if ($values) foreach($values as $param=&gt;$value) $stmt-&gt;bindValue($param, $value); if ( ! $stmt-&gt;execute() ) { error_log ("PDO Error: ".json_encode($stmt-&gt;errorInfo())); return false; } } catch (PDOException $e) { error_log ("Exception: " . $e-&gt;getMessage()); return false; } return $stmt; } </code></pre> <p>and after that the strings are saving (via INSERT statement) to db with <strong>question marks</strong> instead of non-ASCII symbols</p> <p>PS. I perform <code>set names 'utf8'</code> before any sql request, all php stuff is cofigured for UTF-8, html document header contains meta tag with UTF-8 secified as charset; the only thing I didn't try is to change default charset of schema itself (it's currently latin1) since I'm pretty sure it's not at issue. Or is it?</p> <p><img src="https://i.stack.imgur.com/8fJFt.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload