redolent
redolent

Reputation: 4259

MySQL: Table name with UTF characters

I'm having a hard time creating a table in MySQL with UTF characters. I am completely lost on how to solve this one.

There's only two special characters in this particular table name:

Code:

CREATE TABLE `📒_❎` (id INT(11) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT);

Message:

Invalid utf8 character string: '📒_❎'

This works, however:

SELECT _utf8'📒_❎'

Upvotes: 2

Views: 2002

Answers (2)

yakiro
yakiro

Reputation: 763

Take a look at the following page: http://dev.mysql.com/doc/refman/5.1/en/identifiers.html

The problematic char is 1F4D2, as the documentation states:

Permitted characters in quoted identifiers include the full Unicode Basic Multilingual Plane (BMP), except U+0000:

ASCII: U+0001 .. U+007F

Extended: U+0080 .. U+FFFF

ASCII NUL (U+0000) and supplementary characters (U+10000 and higher) are not permitted in quoted or unquoted identifiers.

Upvotes: 5

Machavity
Machavity

Reputation: 31614

If you're using MySQL 5.5.3 or later I would set your character set to utf8mb4

Upvotes: 3

Related Questions