Kevin Lieser
Kevin Lieser

Reputation: 987

HTML Form/Textarea with Emoji store to MySQL Database

I have a small Website where Users can post a status. If a User post a status with an Emoji (e.g. from iOS) the Emoji Char get stored in the MySQL Database like this: 😁

I'm using an MySQL Version 5.5 with utf8mb4:

+--------------------------+--------------------+
| Variable_name            | Value              |
+--------------------------+--------------------+
| character_set_client     | utf8mb4            |
| character_set_connection | utf8mb4            |
| character_set_database   | utf8mb4            |
| character_set_filesystem | binary             |
| character_set_results    | utf8mb4            |
| character_set_server     | utf8mb4            |
| character_set_system     | utf8               |
| collation_connection     | utf8mb4_general_ci |
| collation_database       | utf8mb4_general_ci |
| collation_server         | utf8mb4_general_ci |
+--------------------------+--------------------+

But the Text/Emoji get always stored as HTML entity. The PHP files are UTF-8 Encoded and the Form looks like this:

<form id="submit_form" action="myAction.php" method="post">

How do i get the real Emoji Char instead of an HTML entity?

Upvotes: 0

Views: 1376

Answers (1)

Kevin Lieser
Kevin Lieser

Reputation: 987

Doh! I just forgot <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

Hope this helps anyone, too..

Upvotes: 0

Related Questions