Questions tagged [utf8mb4]

Unlike its `utf8` encoding, MySQL’s `utf8mb4` encoding offers full Unicode support (including four-byte UTF-8-encoded symbols).

Unlike its utf8 encoding, MySQL’s utf8mb4 encoding offers full Unicode support (including four-byte UTF-8-encoded symbols).

The utf8mb4 character set is useful because nowadays we need support for storing not only language characters but also symbols, newly introduced emojis, and so on.

utf8mb4 has been available since MySQL 5.5.3 (released March 2010).

A nice read on How to support full Unicode in MySQL databases by Mathias Bynens can also shed some light on this.

More information about the utf8mb4 character set may be found on the official MySQL Documentation.

398 questions
0
votes
1 answer

Error saving UTF8mb4 Emoji in mysql (mariadb) database via PHPmyAdmin Error #1366

I'm getting a strange error. I am only able to save ❤️ in the mysql db. All other emojis i tested are not storaged in the database. Warning: #1366 Wrong string See screenshot. I did the following things 1. In my.cnf set default-character-set =…
fcb1900
  • 339
  • 4
  • 21
0
votes
0 answers

MySQLWorkBench unable to set foreign key

For this issue it only happens on the GUI side, Script still works fine Have been looking for answers and the closest i found is Mysql Workbench Can't Select Foreign Key but it doesn't really answer the question considering in the create statement…
Solly
  • 41
  • 5
0
votes
0 answers

Why using SQLAlchemy, the insert of a row with no-ASCII in the JSON col on MariaDB 10.3.17 raise an UnicodeEncodeError?

I must insert a row witha json column in a table on MySQL/MariaDB DB, often the json column contains utf8 chars as euro sign (€). I'm using python 3.9 and SQLAlchemy. When I execute the insert on MySQL 5.7, all goes fine. When i try on new MariaDB…
Stefano G.
  • 143
  • 2
  • 14
0
votes
0 answers

Incorrect string value: '\xF0\x9F\x98\xA0",...' for column 'properties' error in MySQL Events data

I know there are a bunch of posts relating to this issue. But nothing worked for me. The issue is I get this error when I insert events data into mysql table. This error specifically comes due to properties column which is of JSON type. I know this…
0
votes
1 answer

Mysql changing the collation from latin1_swedish_ci to utf8mb4_bin

One of my columns has special characters like "Ψ" which latin1_swedish_ci does not seem to support. To handle such cases I tried switching the collation to utf8mb4_bin for the one column. But when converting the data i get: Query error: #1366 -…
LTM
  • 527
  • 1
  • 9
  • 18
0
votes
2 answers

Invalid UTF-8 in SQL dump

I have a MySQL dump, which is not valid UTF-8. Two questions: Could this be caused by some of the database using utf8mb3 aka MySQL's 'utf8'? It definitely does use this encoding. If so, how can I fix it, without having access to MySQL to import,…
Zachary Vance
  • 752
  • 4
  • 18
0
votes
1 answer

How to avoid invalid errors when comparing integers with explicit collation in MySQL 5.6

Okay, not the clearest title ever; feel free to improve. I have a table representing thousands of linguistic forms. Many of these make heavy use of diacritics, so all of aha, áha̱ and ā̧́ḫà̀ may appear. The table (and the database) uses UTF-8 as…
Janus Bahs Jacquet
  • 859
  • 1
  • 11
  • 27
0
votes
0 answers

Possible to have only some fields use utf8mb4 with Laravel, Doctrine, and MySQL?

We have an application running Laravel 5.6 on MySQL 5.6. We can't upgrade those yet. We're hoping to fix an issue with accepting "special characters" in a form, but without upgrading MySQL yet. I've changed the collation and and character set of…
0
votes
1 answer

MySQL 5.7 character_set_client stack at utf8mb4

Long story short: we have a PHP-based self-developed CMS, originally on PHP5.x and MySQL, using a healthy combination of utf8 and iso-8859-1 char-sets (don't judge, I know it's weird but it's working). On our production environment our server…
solotherm
  • 95
  • 7
0
votes
0 answers

Add emoji in PHP

Let me explain my problem. On my site, currently my emojis are well displayed, however, on the future version I'm developing, there are the "?" problems when I use the same database (with utf8mb4_general_ci). Is there a PHP alternative to debug…
0
votes
1 answer

Unable to insert Chinese characters into MySQL db Despite creating table with utf8mb4/utf8mb4_general_ci

I've read a lot of posts on Stackoverflow and generally and they still do not seem to address my situation. Running Laravel 7.x on PHP 7.4, I'm using Laravel-Excel to import into the db. Screenshot shows my database.php and table have the…
user1729972
  • 712
  • 2
  • 9
  • 29
0
votes
0 answers

Should the mysql system database have its encoding and collation updated?

The background: I have an old MariaDB 5.5 installation which has all configuration defaults, databases, tables and columns set to utf8/utf8_general_ci. I want to change everything to utf8mb4/utf8mb4_unicode_ci. My question: Should I also update the…
jamieburchell
  • 761
  • 1
  • 5
  • 18
0
votes
1 answer

Collation change utf8mb4_unicode_ci to utf8mb4_general_ci

For my databases, I used utf8mb4_unicode_ci with utf8mb4 character set as a default. This was a mistake and the folks who are using the databases I created are complaining about the collation. I need to convert it to utf8mb4_general_ci. Am I able to…
AndrewD
  • 258
  • 4
  • 17
0
votes
1 answer

Character Encoding of spaces in wordpress:   shows as ? in black diamond

I am having a lot of trouble with changing the encoding of an existing wordpress site. Basically the site was mostly in English (latin characters) however now we need to include many other languages such as Thai and Chinese etc. I have changed the…
nicole2292
  • 111
  • 1
  • 9
0
votes
0 answers

Problem with decode tildes and special chars (PHP and MYSQL)

I need your help since I have a problem with accents and special characters. The thing is that I need to save an array in a database, so what I do is the following: $serialized_array = json_encode($products, JSON_UNESCAPED_UNICODE); The problem is…