title: General error: 1366 Incorrect string value: '\xF0\x9F\x8D\xB8 !...'
body: <p>The following error appears when a user sends a message containing an emoji (precisely, when the message is stored in MySql database) :</p>
  
  <blockquote>
    <p>PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect string
    value: '\xF0\x9F\x8D\xB8 !...' for column 'message' at row 1 in ...</p>
  </blockquote>
  
  <p>I already check the following questions:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/47419943/pymysql-warning-1366-incorrect-string-value-xf0-x9f-x98-x8d-t">PyMySQL Warning: (1366, &quot;Incorrect string value: &#39;\\xF0\\x9F\\x98\\x8D t...&#39;)</a></li>
  <li><a href="https://stackoverflow.com/questions/13653712/java-sql-sqlexception-incorrect-string-value-xf0-x9f-x91-xbd-xf0-x9f">java.sql.SQLException: Incorrect string value: &#39;\xF0\x9F\x91\xBD\xF0\x9F...&#39;</a></li>
  <li><a href="https://stackoverflow.com/questions/34165523/error-1366-hy000-incorrect-string-value-xf0-x9f-x98-x9c-for-column-comme">ERROR 1366 (HY000): Incorrect string value: &#39;\xF0\x9F\x98\x9C&#39; for column &#39;comment&#39; at row 1</a></li>
  <li><a href="https://stackoverflow.com/questions/20411440/incorrect-string-value-xf0-x9f-x8e-xb6-xf0-x9f-mysql">Incorrect string value: &#39;\xF0\x9F\x8E\xB6\xF0\x9F...&#39; MySQL</a></li>
  </ul>
  
  <p>All the previous questions propose the same answer : altering the table to 
  <code>utf8mb4</code> typeset. This is what I did : I changed my table and the concerned column to <code>utf8mb4_unicode_ci</code>.</p>
  
  <p>But the problem still appears. Any idea ?</p>