Submit a content containing UTF-8 characters

I’ve tried to submit SQL containing UTF-8 characters from PHPMyAdmin, but the resulting contents appears to be incorrect.
What exactly is happening?

We can’t really help you if you don’t give more information.

What command are you sending, what do you want to happen, and what is actually happening?

5 Likes

Command was INSERT, the effected fields were VARCHAR and TEXT.

Did you see this?

I don’t think we can help you

3 Likes

INSERT is not a command, it’s a statement (May be the wrong word).

We need the following:

  1. The FULL SQL command used
  2. The response PHOMyAdmin gave to the command (Either “success” or whatever is displayed in red)
  3. A description of what you want to happen (At least a full sentence, preferably two)
  4. A description of what actually happen when you ran the command (At least a full sentence, preferably two)
3 Likes

So you’re inserting the data through phpMyAdmin. Are you viewing the data with phpMyAdmin as well? Or are you querying it through your website?

Note that phpMyAdmin uses the utf8 charset for the connection (or utf8mb4, not sure), but our PHP stack is configured to use latin1 by default. You can set the charset to use through your PHP connection code. Most frameworks and CMS should do this by default. It’s strongly recommended you set this to utf8 or utf8mb4 instead.

And if you’re wondering what utf8mb4 is, then know that utf8 in MySQL isn’t real UTF-8, but a shortcut from the MySQL developers, whereas utf8mb4 is the “real” UTF-8. MySQL utf8 and utf8mb4 store special characters in the same way, but emoji don’t aren’t supported correctly by utf8, you need utf8mb4 for that.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.